diff -r 795c26a59016 dwm.h --- a/dwm.h Sun Aug 26 12:54:20 2007 +0200 +++ b/dwm.h Wed Sep 05 17:05:35 2007 +0200 @@ -50,7 +50,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; diff -r 795c26a59016 screen.c --- a/screen.c Sun Aug 26 12:54:20 2007 +0200 +++ b/screen.c Wed Sep 05 17:05:35 2007 +0200 @@ -295,18 +295,24 @@ void void togglemax(const char *arg) { XEvent ev; - - if(!sel || (!isfloating() && !sel->isfloating) || sel->isfixed) + if(!sel) return; if((sel->ismax = !sel->ismax)) { + sel->wasfloating = sel->isfloating; + sel->isfloating = True; 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 - resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True); + else { + if(sel->wasfloating) + resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True); + else + sel->isfloating = False; + } + arrange(); drawstatus(); while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); }