JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
fix
[dwm.git] / view.c
diff --git a/view.c b/view.c
index c005a33..561d4ef 100644 (file)
--- a/view.c
+++ b/view.c
@@ -317,9 +317,16 @@ zoom(Arg *arg)
        if(!sel || sel->isfloat || n < 2 || (arrange != dotile) || maximized)
                return;
 
-       if((c = sel)  == getnext(clients))
-               if(!(c = getnext(c->next)))
-                       return;
+       /* this is somewhat tricky, it asserts to only zoom tiled clients */
+       for(c = getnext(clients); c && c->isfloat; c = getnext(c->next));
+       if(c) {
+               if(c == sel)
+                       for(c = getnext(c->next); c && c->isfloat; c = getnext(c->next));
+               else
+                       c = sel;
+       }
+       if(!c)
+               return;
        detach(c);
        c->next = clients;
        clients->prev = c;