X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=view.c;h=fd53dc8595bfeb969ef68d42e9df524241bff391;hb=114cc3ec020ac81bdb16123f4d956d80a531d830;hp=56671344a1ca30c3061a760d4fba18f0dfd844cc;hpb=346bdea946887d83f857a8944a0189bca51a3e47;p=dwm.git diff --git a/view.c b/view.c index 5667134..fd53dc8 100644 --- a/view.c +++ b/view.c @@ -45,17 +45,18 @@ reorder() { static void togglemax(Client *c) { + XEvent ev; if((c->ismax = !c->ismax)) { c->rx = c->x; c->x = sx; c->ry = c->y; c->y = bh; c->rw = c->w; c->w = sw; - c->rh = c->h; c->h = sh; + c->rh = c->h; c->h = sh - bh; } else { c->x = c->rx; c->y = c->ry; - c->w = c->w; - c->h = c->h; + c->w = c->rw; + c->h = c->rh; } resize(c, True, TopLeft); while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); @@ -101,14 +102,8 @@ dotile(Arg *arg) { w = sw - mw; for(n = 0, c = clients; c; c = c->next) - if(isvisible(c)) { - if(c->isfloat) { - if(c->ismax) - togglemax(c); - } - else - n++; - } + if(isvisible(c) && !c->isfloat) + n++; if(n > 1) h = (sh - bh) / (n - 1); @@ -121,6 +116,8 @@ dotile(Arg *arg) { resize(c, True, TopLeft); continue; } + if(c->ismax) + togglemax(c); if(n == 1) { c->x = sx; c->y = sy + bh; @@ -231,7 +228,7 @@ void restack() { Client *c; XEvent ev; - + if(!sel) { drawstatus(); return; @@ -296,7 +293,6 @@ void zoom(Arg *arg) { unsigned int n; Client *c; - XEvent ev; if(!sel) return;