diff options
Diffstat (limited to '')
| -rw-r--r-- | dwm.c | 15 |
1 files changed, 12 insertions, 3 deletions
| @@ -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 | |||
| 1627 | togglemax(const char *arg) { | 1627 | togglemax(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 | } |
