X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=view.c;h=bb322350810141767841dcadb01df539be3ec42f;hb=05c10c5776738fdfe73c1e66e14c869e2e5e338d;hp=1226f0db98262cc51e2b90175152cef3a9727937;hpb=ca65478c8968434c78aacf4a102ccbbe4a66ad9e;p=dwm.git diff --git a/view.c b/view.c index 1226f0d..bb32235 100644 --- a/view.c +++ b/view.c @@ -3,7 +3,6 @@ * See LICENSE file for license details. */ #include "dwm.h" -#include /* static */ @@ -62,8 +61,6 @@ void dofloat(Arg *arg) { Client *c; - maximized = False; - for(c = clients; c; c = c->next) { if(isvisible(c)) { resize(c, True, TopLeft); @@ -83,8 +80,6 @@ dotile(Arg *arg) { int h, i, n, w; Client *c; - maximized = False; - w = sw - mw; for(n = 0, c = clients; c; c = c->next) if(isvisible(c) && !c->isfloat) @@ -191,7 +186,7 @@ resizecol(Arg *arg) { for(n = 0, c = clients; c; c = c->next) if(isvisible(c) && !c->isfloat) n++; - if(!sel || sel->isfloat || n < 2 || (arrange != dotile) || maximized) + if(!sel || sel->isfloat || n < 2 || (arrange != dotile)) return; if(sel == getnext(clients)) { @@ -274,13 +269,28 @@ viewall(Arg *arg) { void zoom(Arg *arg) { + int tmp; unsigned int n; Client *c; + XEvent ev; + + if(!sel) + return; + + if(sel->isfloat || (arrange == dofloat)) { + sel->x = sx; + sel->y = bh; + sel->w = sw; + sel->h = sh - bh; + resize(sel, True, TopLeft); + while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); + return; + } for(n = 0, c = clients; c; c = c->next) if(isvisible(c) && !c->isfloat) n++; - if(!sel || sel->isfloat || n < 2 || (arrange != dotile) || maximized) + if(n < 2 || (arrange != dotile)) return; if((c = sel) == nexttiled(clients))