Mercurial > dwm-meillo
diff view.c @ 749:6692d7e7e156
added maxlayout by mitch, moved config.h to config.meillo.h, some smaller modifications
author | meillo@marmaro.de |
---|---|
date | Sun, 11 Feb 2007 17:20:22 +0100 |
parents | 0f91934037b0 |
children |
line wrap: on
line diff
--- a/view.c Sun Feb 11 12:20:54 2007 +0100 +++ b/view.c Sun Feb 11 17:20:22 2007 +0100 @@ -117,6 +117,48 @@ restack(); } +/* 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; + + for(c = clients; c; c = c->next) { + if(isvisible(c)) { + if(c->isfloat) { + resize(c, True); + continue; + } + arrangemax(c); + 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); + focus(c); + } + restack(); +} +/* end code by mitch */ + void focusnext(Arg *arg) { Client *c; @@ -192,7 +234,17 @@ return; if(sel->isfloat || arrange == dofloat) XRaiseWindow(dpy, sel->win); - if(arrange != dofloat) { + + /* begin code by mitch */ + if(arrange == domax) { + for(c = nexttiled(clients); c; c = nexttiled(c->next)) { + arrangemax(c); + resize(c, False); + } + + } else if (arrange == dotile) { + /* end code by mitch */ + if(!sel->isfloat) XLowerWindow(dpy, sel->win); for(c = nexttiled(clients); c; c = nexttiled(c->next)) { @@ -215,7 +267,8 @@ void togglemode(Arg *arg) { - arrange = (arrange == dofloat) ? dotile : dofloat; + /* only toggle between tile and max - float is just available through togglefloat */ + arrange = (arrange == dotile) ? domax : dotile; if(sel) arrange(); else