diff options
author | Anselm R. Garbe | 2007-09-18 19:04:50 +0200 |
---|---|---|
committer | Anselm R. Garbe | 2007-09-18 19:04:50 +0200 |
commit | 55e45ec94568a2cc4c65506e53f3564746286a37 (patch) | |
tree | 28ce43d0ea99c1b2c4adc088ac4ea970052605a7 | |
parent | 7c89b7b568656d98a8b196b973991916be1898d5 (diff) | |
download | aur-55e45ec94568a2cc4c65506e53f3564746286a37.tar.gz |
applied Peter Hartlich's togglemax patch to allow toggling tiled clients to maximum
-rw-r--r-- | dwm.1 | 2 | ||||
-rw-r--r-- | dwm.c | 15 |
2 files changed, 13 insertions, 4 deletions
@@ -75,7 +75,7 @@ Focus previous window. Increases the master area width about 5% (tiled layout only). .TP .B Mod1\-m -Toggles maximization of current window (floating layout only). +Toggles maximization of current window. .TP .B Mod1\-Shift\-[1..n] Apply @@ -64,7 +64,7 @@ struct Client { int minax, maxax, minay, maxay; long flags; unsigned int border, oldborder; - Bool isbanned, isfixed, ismax, isfloating; + Bool isbanned, isfixed, ismax, isfloating, wasfloating; Bool *tags; Client *next; Client *prev; @@ -1627,17 +1627,26 @@ void togglemax(const char *arg) { XEvent ev; - if(!sel || (!isarrange(floating) && !sel->isfloating) || sel->isfixed) + if(!sel || sel->isfixed) return; if((sel->ismax = !sel->ismax)) { + if(isarrange(floating) || sel->isfloating) + sel->wasfloating = True; + else { + togglefloating(NULL); + sel->wasfloating = False; + } sel->rx = sel->x; sel->ry = sel->y; sel->rw = sel->w; sel->rh = sel->h; resize(sel, wax, way, waw - 2 * sel->border, wah - 2 * sel->border, True); } - else + else { resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True); + if (!sel->wasfloating) + togglefloating(NULL); + } drawbar(); while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); } |