Alopex

Check-in [d5d62abffb]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:tinkering
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | master
Files: files | file ages | folders
SHA3-256:d5d62abffb45bc09a28ef339647aed4ae56e2bab2966f027e18261c5749654ee
User & Date: jesse@mccluresk9.com 2014-06-13 23:56:52
Context
2014-06-16
20:50
minor cleanup check-in: 7bad7d1bf9 user: jesse@mccluresk9.com tags: trunk, master
2014-06-13
23:56
tinkering check-in: d5d62abffb user: jesse@mccluresk9.com tags: trunk, master
2014-05-06
23:43
added debug code to resource loading check-in: 4313a4b5b6 user: jesse@mccluresk9.com tags: trunk, master
Changes

Changes to src/tile.c.

90
91
92
93
94
95
96
97
98
99
100
101
102

103
104
105
106
107
108
109
			cairo_paint(C->bar->ctx);
		}
		/* sort floating windows */
		// TODO: needs testing
		for (c = clients ; c; c = c->next) {
			if (!(M->tags & c->tags)) continue;
			else if (c->flags & WIN_FULL_TEST) {
				if ( !winmarks[1] || !(winmarks[1]->flags & WIN_FULL_TEST) )
					winmarks[1] = c;
				XMoveResizeWindow(dpy, c->win, M->x, M->y, M->w, M->h);
			}
			else if (c->flags & WIN_FLOAT)
				XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);

		}
		if (!M->focus) M->focus = M->container;
	}
	for (c = clients; c; c = c->next) {
		if (!(c->tags & mview)) purgatory(c->win);
	}
	draw_bars(False);







|
|


|

>







90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
			cairo_paint(C->bar->ctx);
		}
		/* sort floating windows */
		// TODO: needs testing
		for (c = clients ; c; c = c->next) {
			if (!(M->tags & c->tags)) continue;
			else if (c->flags & WIN_FULL_TEST) {
if ( !winmarks[1] || !(winmarks[1]->flags & WIN_FLOAT))
winmarks[1] = c;
				XMoveResizeWindow(dpy, c->win, M->x, M->y, M->w, M->h);
			}
			else if (c->flags & WIN_FLOAT) {
				XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
			}
		}
		if (!M->focus) M->focus = M->container;
	}
	for (c = clients; c; c = c->next) {
		if (!(c->tags & mview)) purgatory(c->win);
	}
	draw_bars(False);

Changes to src/xlib.c.

417
418
419
420
421
422
423
424
425
426



427
428
429
430
431
432
433
434
435
436
437
...
485
486
487
488
489
490
491




492
493
494
495
496
497
498
...
572
573
574
575
576
577
578

579
580
581
582
583
584
585
...
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
...
602
603
604
605
606
607
608

609
610
611
612
613
614
615
	if ( !(c->title=get_text(c,NET_WM_NAME)) )
		if ( !(c->title=get_text(c,XA_WM_NAME)) )
			c->title = strdup(noname);
	return 0;
}

int get_size(Client *c) {
	long ret;
	XSizeHints hint;
	if (!(XGetWMNormalHints(dpy,c->win,&hint,&ret))) hint.flags = 0;



	if (hint.flags & PBaseSize) {
		c->w = hint.base_width; c->h = hint.base_height;
	}
	else if (hint.flags & PMinSize) {
		if (c->w < hint.min_width) c->w = hint.min_width;
		if (c->h < hint.min_height) c->h = hint.min_height;
	}
	return 0;
}

/**** EVENT HANDLERS ****/
................................................................................
	Client *c;
	XWindowChanges wc;
	if ( (c=wintoclient(e->window)) ) {
		if (e->value_mask & CWX) c->x = e->x;
		if (e->value_mask & CWY) c->y = e->y;
		if (e->value_mask & CWWidth) c->w = e->width;
		if (e->value_mask & CWHeight) c->h = e->height;




		if (c->w == m->w && c->h == m->h) c->flags |= WIN_FULL;
		/* Let gtk3 windows know we're listening: */
		XConfigureEvent cn;
		cn.type = ConfigureNotify; cn.display = dpy;
		cn.event = cn.window = c->win;
		cn.x = c->x; cn.y = c->y; cn.width = c->w; cn.height = c->h;
		cn.border_width = 0;
................................................................................
	if ( (c=wintoclient(e->window)) ) return;
	c = calloc(1, sizeof(Client));
	c->win = e->window;
// check for fullscreen
	get_hints(c);
	get_icon(c);
	get_name(c);

	apply_rules(c);
	if (!c->tags && !(c->tags=m->tags)) {
		Monitor *M;
		int i, tags = 0;
		for (M = mons; M; M = M->next) tags |= M->tags;
//fprintf(stderr,"ADD TAG tags=%X\n",tags);
		for (i = 0; ((1<<i) & tags) && i < 9; i++);
................................................................................
		c->tags = m->tags = (1<<i);
	}
	if (XGetTransientForHint(dpy, c->win, &c->parent))
		c->flags |= WIN_TRANS;
	else
		c->parent = e->parent;
	c->x = wa.x; c->y = wa.y; c->w = wa.width; c->h = wa.height;
	get_size(c);
	if (c->w == m->w && c->h == m->h) c->flags |= WIN_FULL;
	XSelectInput(dpy, c->win, PropertyChangeMask | EnterWindowMask);
	Client *p;
	switch (conf.attach) {
		case ATTACH_TOP: c->next = clients; clients = c; break;
		case ATTACH_BOTTOM: push_client(c, NULL); break;
		case ATTACH_ABOVE: push_client(c, m->focus->top); break;
................................................................................
		case ATTACH_BELOW: push_client(c, m->focus->top->next); break;
	}
	winmarks[0] = winmarks[1];
	winmarks[1] = c;
	purgatory(c->win);
	XMapWindow(dpy, c->win);
	tile();

}

void propertynotify(XEvent *ev) {
	XPropertyEvent *e = &ev->xproperty;
	Client *c;
	if (e->window == root) {
		char *cmd;







|

|
>
>
>



|







 







>
>
>
>







 







>







 







<







 







>







417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
...
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
...
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
...
595
596
597
598
599
600
601

602
603
604
605
606
607
608
...
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
	if ( !(c->title=get_text(c,NET_WM_NAME)) )
		if ( !(c->title=get_text(c,XA_WM_NAME)) )
			c->title = strdup(noname);
	return 0;
}

int get_size(Client *c) {
	long ret = 0;
	XSizeHints hint;
	if (!(XGetWMNormalHints(dpy,c->win,&hint,&ret))) return 0;
	if (hint.flags & PSize) {
		c->w = hint.width; c->h = hint.height;
	}
	if (hint.flags & PBaseSize) {
		c->w = hint.base_width; c->h = hint.base_height;
	}
	if (hint.flags & PMinSize) {
		if (c->w < hint.min_width) c->w = hint.min_width;
		if (c->h < hint.min_height) c->h = hint.min_height;
	}
	return 0;
}

/**** EVENT HANDLERS ****/
................................................................................
	Client *c;
	XWindowChanges wc;
	if ( (c=wintoclient(e->window)) ) {
		if (e->value_mask & CWX) c->x = e->x;
		if (e->value_mask & CWY) c->y = e->y;
		if (e->value_mask & CWWidth) c->w = e->width;
		if (e->value_mask & CWHeight) c->h = e->height;
		if (c->flags & WIN_FULL_TEST) {
			c->flags &= ~WIN_FULL;
			c->flags |= WIN_FLOAT;
		}
		if (c->w == m->w && c->h == m->h) c->flags |= WIN_FULL;
		/* Let gtk3 windows know we're listening: */
		XConfigureEvent cn;
		cn.type = ConfigureNotify; cn.display = dpy;
		cn.event = cn.window = c->win;
		cn.x = c->x; cn.y = c->y; cn.width = c->w; cn.height = c->h;
		cn.border_width = 0;
................................................................................
	if ( (c=wintoclient(e->window)) ) return;
	c = calloc(1, sizeof(Client));
	c->win = e->window;
// check for fullscreen
	get_hints(c);
	get_icon(c);
	get_name(c);
//	get_size(c);
	apply_rules(c);
	if (!c->tags && !(c->tags=m->tags)) {
		Monitor *M;
		int i, tags = 0;
		for (M = mons; M; M = M->next) tags |= M->tags;
//fprintf(stderr,"ADD TAG tags=%X\n",tags);
		for (i = 0; ((1<<i) & tags) && i < 9; i++);
................................................................................
		c->tags = m->tags = (1<<i);
	}
	if (XGetTransientForHint(dpy, c->win, &c->parent))
		c->flags |= WIN_TRANS;
	else
		c->parent = e->parent;
	c->x = wa.x; c->y = wa.y; c->w = wa.width; c->h = wa.height;

	if (c->w == m->w && c->h == m->h) c->flags |= WIN_FULL;
	XSelectInput(dpy, c->win, PropertyChangeMask | EnterWindowMask);
	Client *p;
	switch (conf.attach) {
		case ATTACH_TOP: c->next = clients; clients = c; break;
		case ATTACH_BOTTOM: push_client(c, NULL); break;
		case ATTACH_ABOVE: push_client(c, m->focus->top); break;
................................................................................
		case ATTACH_BELOW: push_client(c, m->focus->top->next); break;
	}
	winmarks[0] = winmarks[1];
	winmarks[1] = c;
	purgatory(c->win);
	XMapWindow(dpy, c->win);
	tile();
	//if (c->flags & WIN_FLOAT) XRaiseWindow(dpy, c->win);
}

void propertynotify(XEvent *ev) {
	XPropertyEvent *e = &ev->xproperty;
	Client *c;
	if (e->window == root) {
		char *cmd;