X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=view.c;h=fce7309dc49e75631bb74c393b9381cca7b44e4f;hb=d800ec05ff63451193a0b858c114f5144534c2a1;hp=80d483ae4392e8c921f826e2c7a724ff55fab02f;hpb=bda53ac6ad834824e8e5d5678ccd638a122c173a;p=dwm.git diff --git a/view.c b/view.c index 80d483a..fce7309 100644 --- a/view.c +++ b/view.c @@ -61,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); @@ -82,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) @@ -190,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)) { @@ -273,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)) { + tmp = sel->x; sel->x = sel->rx; sel->rx = tmp; + tmp = sel->y; sel->y = sel->ry; sel->ry = tmp; + tmp = sel->w; sel->w = sel->rw; sel->rw = tmp; + tmp = sel->h; sel->h = sel->rh; sel->rh = tmp; + 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))