# HG changeset patch # User meillo@marmaro.de # Date 1228508090 -3600 # Node ID a1c6805aa0182a04338e9d9624690a5b3255f22c # Parent 706991d154519ac684338e3dfc4f852cef976b45 simplified and corrected domax() and restack() diff -r 706991d15451 -r a1c6805aa018 aewl.c --- a/aewl.c Fri Dec 05 20:50:31 2008 +0100 +++ b/aewl.c Fri Dec 05 21:14:50 2008 +0100 @@ -314,22 +314,6 @@ /* begin code by mitch */ void -arrangemax(Client *c) { - if(c == sel) { - c->ismax = True; - c->x = sx; - c->y = bh; - c->w = sw - 2 * BORDERPX; - c->h = sh - bh - 2 * BORDERPX; - XRaiseWindow(dpy, c->win); - } else { - c->ismax = False; - XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); - XLowerWindow(dpy, c->win); - } -} - -void domax(void) { Client *c; @@ -339,12 +323,15 @@ resize(c, True); continue; } - arrangemax(c); + c->ismax = True; + c->x = sx; + c->y = bh; + c->w = sw - 2 * BORDERPX; + c->h = sh - bh - 2 * BORDERPX; resize(c, False); } else { XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); } - } if(!sel || !isvisible(sel)) { for(c = stack; c && !isvisible(c); c = c->snext); @@ -406,24 +393,14 @@ if(sel->isfloat) XRaiseWindow(dpy, sel->win); - /* begin code by mitch */ - if(arrange == domax) { - for(c = nexttiled(clients); c; c = nexttiled(c->next)) { - arrangemax(c); - resize(c, False); - } + if(!sel->isfloat) + XLowerWindow(dpy, sel->win); + for(c = nexttiled(clients); c; c = nexttiled(c->next)) { + if(c == sel) + continue; + XLowerWindow(dpy, c->win); + } - } else if (arrange == dotile) { - /* end code by mitch */ - - if(!sel->isfloat) - XLowerWindow(dpy, sel->win); - for(c = nexttiled(clients); c; c = nexttiled(c->next)) { - if(c == sel) - continue; - XLowerWindow(dpy, c->win); - } - } XSync(dpy, False); while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); } @@ -557,7 +534,9 @@ Client * getnext(Client *c) { - for(; c && !isvisible(c); c = c->next); + while(c && !isvisible(c)) { + c = c->next; + } return c; }