X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=view.c;h=ac201e60e13ba39ceafba9fa52cd68cd860f9793;hb=0915da8842fd6e16b804ae3205ec2f6baaaa342c;hp=d61d0deb9efab7521d917cfa6cb0114356461a00;hpb=52a3ab10423a4133e38281e4e19769cd3c2ed931;p=dwm.git diff --git a/view.c b/view.c index d61d0de..ac201e6 100644 --- a/view.c +++ b/view.c @@ -38,6 +38,13 @@ reorder() clients = newclients; } +static Client * +nexttiled(Client *c) +{ + for(c = getnext(c->next); c && c->isfloat; c = getnext(c->next)); + return c; +} + /* extern */ void (*arrange)(Arg *) = DEFMODE; @@ -317,10 +324,9 @@ zoom(Arg *arg) if(!sel || sel->isfloat || n < 2 || (arrange != dotile) || maximized) return; - if((c = sel) == getnext(clients)) - for(c = getnext(c->next); c && c->isfloat; c = getnext(c->next)); - if(!c) - return; + if((c = sel) == nexttiled(clients)) + if(!(c = nexttiled(c))) + return; detach(c); c->next = clients; clients->prev = c;