made arrange again like it was once c2a916bf
Anselm R Garbe · 2008-06-19 14:58 1 file(s) · +15 −15
dwm.c +15 −15
53 53
#define MOUSEMASK       (BUTTONMASK|PointerMotionMask)
54 54
#define TAGMASK         ((int)((1LL << LENGTH(tags)) - 1))
55 55
#define TEXTW(x)        (textnw(x, strlen(x)) + dc.font.height)
56 +
#define ISVISIBLE(x)    (x->tags & tagset[seltags])
56 57
57 58
/* enums */
58 59
enum { CurNormal, CurResize, CurMove, CurLast };        /* cursor */
89 90
	int basew, baseh, incw, inch, maxw, maxh, minw, minh;
90 91
	int bw, oldbw;
91 92
	uint tags;
92 -
	Bool isbanned, isfixed, isfloating, isurgent;
93 +
	Bool isfixed, isfloating, isurgent;
93 94
	Client *next;
94 95
	Client *snext;
95 96
	Window win;
273 274
	Client *c;
274 275
275 276
	for(c = clients; c; c = c->next)
276 -
		if(c->tags & tagset[seltags]) { /* is visible */
277 -
			c->isbanned = False;
277 +
		if(ISVISIBLE(c)) {
278 +
			XMoveWindow(dpy, c->win, c->x, c->y);
278 279
			if(!lt[sellt]->arrange || c->isfloating)
279 280
				resize(c, c->x, c->y, c->w, c->h, True);
280 281
		}
281 -
		else if(!c->isbanned) {
282 +
		else {
282 283
			XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
283 -
			c->isbanned = True;
284 284
		}
285 285
286 286
	focus(NULL);
428 428
				c->y = sy + (sh / 2 - c->h / 2); /* center in y direction */
429 429
			if((ev->value_mask & (CWX|CWY)) && !(ev->value_mask & (CWWidth|CWHeight)))
430 430
				configure(c);
431 -
			if(!c->isbanned)
431 +
			if(ISVISIBLE(c))
432 432
				XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
433 433
		}
434 434
		else
605 605
606 606
void
607 607
focus(Client *c) {
608 -
	if(!c || c->isbanned)
609 -
		for(c = stack; c && c->isbanned; c = c->snext);
608 +
	if(!c || !ISVISIBLE(c))
609 +
		for(c = stack; c && !ISVISIBLE(c); c = c->snext);
610 610
	if(sel && sel != c) {
611 611
		grabbuttons(sel, False);
612 612
		XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]);
639 639
	if(!sel)
640 640
		return;
641 641
	if (arg->i > 0) {
642 -
		for(c = sel->next; c && c->isbanned; c = c->next);
642 +
		for(c = sel->next; c && !ISVISIBLE(c); c = c->next);
643 643
		if(!c)
644 -
			for(c = clients; c && c->isbanned; c = c->next);
644 +
			for(c = clients; c && !ISVISIBLE(c); c = c->next);
645 645
	}
646 646
	else {
647 647
		for(i = clients; i != sel; i = i->next)
648 -
			if (!i->isbanned)
648 +
			if(ISVISIBLE(i))
649 649
				c = i;
650 650
		if(!c)
651 651
			for(; i; i = i->next)
652 -
				if (!i->isbanned)
652 +
				if(ISVISIBLE(i))
653 653
					c = i;
654 654
	}
655 655
	if(c) {
1018 1018
1019 1019
Client *
1020 1020
nexttiled(Client *c) {
1021 -
	for(; c && (c->isfloating || c->isbanned); c = c->next);
1021 +
	for(; c && (c->isfloating || !ISVISIBLE(c)); c = c->next);
1022 1022
	return c;
1023 1023
}
1024 1024
1113 1113
		h = bh;
1114 1114
	if(w < bh)
1115 1115
		w = bh;
1116 -
	if(!c->isbanned || c->x != x || c->y != y || c->w != w || c->h != h) {
1116 +
	if(c->x != x || c->y != y || c->w != w || c->h != h) {
1117 1117
		c->x = wc.x = x;
1118 1118
		c->y = wc.y = y;
1119 1119
		c->w = wc.width = w;
1189 1189
		wc.stack_mode = Below;
1190 1190
		wc.sibling = barwin;
1191 1191
		for(c = stack; c; c = c->snext)
1192 -
			if(!c->isfloating && !c->isbanned) {
1192 +
			if(!c->isfloating && ISVISIBLE(c)) {
1193 1193
				XConfigureWindow(dpy, c->win, CWSibling|CWStackMode, &wc);
1194 1194
				wc.sibling = c->win;
1195 1195
			}