Mercurial > aewl
changeset 768:a1c6805aa018
simplified and corrected domax() and restack()
author | meillo@marmaro.de |
---|---|
date | Fri, 05 Dec 2008 21:14:50 +0100 (2008-12-05) |
parents | 706991d15451 |
children | 49aa8ccceefa |
files | aewl.c |
diffstat | 1 files changed, 15 insertions(+), 36 deletions(-) [+] |
line wrap: on
line diff
--- 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; }