summaryrefslogtreecommitdiffstats
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
parentmade all stuff non-static - so you can choose wether to use dwm the static or... (diff)
downloaddwm-08c2d924809ca6e397126532c52955c3c04237e2.tar.gz
dwm-08c2d924809ca6e397126532c52955c3c04237e2.zip
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 {
64 int minax, maxax, minay, maxay; 64 int minax, maxax, minay, maxay;
65 long flags; 65 long flags;
66 unsigned int border, oldborder; 66 unsigned int border, oldborder;
67 Bool isbanned, isfixed, ismax, isfloating; 67 Bool isbanned, isfixed, ismax, isfloating, wasfloating;
68 Bool *tags; 68 Bool *tags;
69 Client *next; 69 Client *next;
70 Client *prev; 70 Client *prev;
@@ -1627,17 +1627,26 @@ void
1627togglemax(const char *arg) { 1627togglemax(const char *arg) {
1628 XEvent ev; 1628 XEvent ev;
1629 1629
1630 if(!sel || (!isarrange(floating) && !sel->isfloating) || sel->isfixed) 1630 if(!sel || sel->isfixed)
1631 return; 1631 return;
1632 if((sel->ismax = !sel->ismax)) { 1632 if((sel->ismax = !sel->ismax)) {
1633 if(isarrange(floating) || sel->isfloating)
1634 sel->wasfloating = True;
1635 else {
1636 togglefloating(NULL);
1637 sel->wasfloating = False;
1638 }
1633 sel->rx = sel->x; 1639 sel->rx = sel->x;
1634 sel->ry = sel->y; 1640 sel->ry = sel->y;
1635 sel->rw = sel->w; 1641 sel->rw = sel->w;
1636 sel->rh = sel->h; 1642 sel->rh = sel->h;
1637 resize(sel, wax, way, waw - 2 * sel->border, wah - 2 * sel->border, True); 1643 resize(sel, wax, way, waw - 2 * sel->border, wah - 2 * sel->border, True);
1638 } 1644 }
1639 else 1645 else {
1640 resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True); 1646 resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True);
1647 if (!sel->wasfloating)
1648 togglefloating(NULL);
1649 }
1641 drawbar(); 1650 drawbar();
1642 while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); 1651 while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
1643} 1652}