aboutsummaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <garbeam@gmail.com>2007-09-18 19:04:50 +0200
committerAnselm R. Garbe <garbeam@gmail.com>2007-09-18 19:04:50 +0200
commit08c2d924809ca6e397126532c52955c3c04237e2 (patch)
treed0b7e9a67147b404f290aced675b01e87e390b43 /dwm.c
parentfe2775a15ba2d4900788c57194da2bad3d19cfaf (diff)
downloaddwm-08c2d924809ca6e397126532c52955c3c04237e2.tar.gz
applied Peter Hartlich's togglemax patch to allow toggling tiled clients to maximum
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/dwm.c b/dwm.c
index 726e797..36ca4eb 100644
--- a/dwm.c
+++ b/dwm.c
@@ -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));
}
remember that computers suck.