summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnselm R Garbe <garbeam@gmail.com>2008-06-19 14:58:19 +0100
committerAnselm R Garbe <garbeam@gmail.com>2008-06-19 14:58:19 +0100
commitc2a916bf3021d9e16419eccbd553d967404ad6e4 (patch)
treebd12cc24c3bd3f86b771d30e2d0683fe6192b4c7
parentfix (diff)
downloaddwm-c2a916bf3021d9e16419eccbd553d967404ad6e4.tar.gz
dwm-c2a916bf3021d9e16419eccbd553d967404ad6e4.zip
made arrange again like it was once
Diffstat (limited to '')
-rw-r--r--dwm.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/dwm.c b/dwm.c
index fcdab10..3c5e6df 100644
--- a/dwm.c
+++ b/dwm.c
@@ -53,6 +53,7 @@
53#define MOUSEMASK (BUTTONMASK|PointerMotionMask) 53#define MOUSEMASK (BUTTONMASK|PointerMotionMask)
54#define TAGMASK ((int)((1LL << LENGTH(tags)) - 1)) 54#define TAGMASK ((int)((1LL << LENGTH(tags)) - 1))
55#define TEXTW(x) (textnw(x, strlen(x)) + dc.font.height) 55#define TEXTW(x) (textnw(x, strlen(x)) + dc.font.height)
56#define ISVISIBLE(x) (x->tags & tagset[seltags])
56 57
57/* enums */ 58/* enums */
58enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ 59enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
@@ -89,7 +90,7 @@ struct Client {
89 int basew, baseh, incw, inch, maxw, maxh, minw, minh; 90 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
90 int bw, oldbw; 91 int bw, oldbw;
91 uint tags; 92 uint tags;
92 Bool isbanned, isfixed, isfloating, isurgent; 93 Bool isfixed, isfloating, isurgent;
93 Client *next; 94 Client *next;
94 Client *snext; 95 Client *snext;
95 Window win; 96 Window win;
@@ -273,14 +274,13 @@ arrange(void) {
273 Client *c; 274 Client *c;
274 275
275 for(c = clients; c; c = c->next) 276 for(c = clients; c; c = c->next)
276 if(c->tags & tagset[seltags]) { /* is visible */ 277 if(ISVISIBLE(c)) {
277 c->isbanned = False; 278 XMoveWindow(dpy, c->win, c->x, c->y);
278 if(!lt[sellt]->arrange || c->isfloating) 279 if(!lt[sellt]->arrange || c->isfloating)
279 resize(c, c->x, c->y, c->w, c->h, True); 280 resize(c, c->x, c->y, c->w, c->h, True);
280 } 281 }
281 else if(!c->isbanned) { 282 else {
282 XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); 283 XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
283 c->isbanned = True;
284 } 284 }
285 285
286 focus(NULL); 286 focus(NULL);
@@ -428,7 +428,7 @@ configurerequest(XEvent *e) {
428 c->y = sy + (sh / 2 - c->h / 2); /* center in y direction */ 428 c->y = sy + (sh / 2 - c->h / 2); /* center in y direction */
429 if((ev->value_mask & (CWX|CWY)) && !(ev->value_mask & (CWWidth|CWHeight))) 429 if((ev->value_mask & (CWX|CWY)) && !(ev->value_mask & (CWWidth|CWHeight)))
430 configure(c); 430 configure(c);
431 if(!c->isbanned) 431 if(ISVISIBLE(c))
432 XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); 432 XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
433 } 433 }
434 else 434 else
@@ -605,8 +605,8 @@ expose(XEvent *e) {
605 605
606void 606void
607focus(Client *c) { 607focus(Client *c) {
608 if(!c || c->isbanned) 608 if(!c || !ISVISIBLE(c))
609 for(c = stack; c && c->isbanned; c = c->snext); 609 for(c = stack; c && !ISVISIBLE(c); c = c->snext);
610 if(sel && sel != c) { 610 if(sel && sel != c) {
611 grabbuttons(sel, False); 611 grabbuttons(sel, False);
612 XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]); 612 XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]);
@@ -639,17 +639,17 @@ focusstack(const Arg *arg) {
639 if(!sel) 639 if(!sel)
640 return; 640 return;
641 if (arg->i > 0) { 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 if(!c) 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 else { 646 else {
647 for(i = clients; i != sel; i = i->next) 647 for(i = clients; i != sel; i = i->next)
648 if (!i->isbanned) 648 if(ISVISIBLE(i))
649 c = i; 649 c = i;
650 if(!c) 650 if(!c)
651 for(; i; i = i->next) 651 for(; i; i = i->next)
652 if (!i->isbanned) 652 if(ISVISIBLE(i))
653 c = i; 653 c = i;
654 } 654 }
655 if(c) { 655 if(c) {
@@ -1018,7 +1018,7 @@ movemouse(const Arg *arg) {
1018 1018
1019Client * 1019Client *
1020nexttiled(Client *c) { 1020nexttiled(Client *c) {
1021 for(; c && (c->isfloating || c->isbanned); c = c->next); 1021 for(; c && (c->isfloating || !ISVISIBLE(c)); c = c->next);
1022 return c; 1022 return c;
1023} 1023}
1024 1024
@@ -1113,7 +1113,7 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
1113 h = bh; 1113 h = bh;
1114 if(w < bh) 1114 if(w < bh)
1115 w = bh; 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 c->x = wc.x = x; 1117 c->x = wc.x = x;
1118 c->y = wc.y = y; 1118 c->y = wc.y = y;
1119 c->w = wc.width = w; 1119 c->w = wc.width = w;
@@ -1189,7 +1189,7 @@ restack(void) {
1189 wc.stack_mode = Below; 1189 wc.stack_mode = Below;
1190 wc.sibling = barwin; 1190 wc.sibling = barwin;
1191 for(c = stack; c; c = c->snext) 1191 for(c = stack; c; c = c->snext)
1192 if(!c->isfloating && !c->isbanned) { 1192 if(!c->isfloating && ISVISIBLE(c)) {
1193 XConfigureWindow(dpy, c->win, CWSibling|CWStackMode, &wc); 1193 XConfigureWindow(dpy, c->win, CWSibling|CWStackMode, &wc);
1194 wc.sibling = c->win; 1194 wc.sibling = c->win;
1195 } 1195 }