dwm-meillo
diff view.c @ 423:6ba5dd429122
applied checking existance of >2 tiles patch (proposed by sander) to zoom and resizecol
author | Anselm R. Garbe <arg@10kloc.org> |
---|---|
date | Tue, 05 Sep 2006 16:00:09 +0200 |
parents | 44225ee80236 |
children | 67f37b93ac73 |
line diff
1.1 --- a/view.c Tue Sep 05 13:52:23 2006 +0200 1.2 +++ b/view.c Tue Sep 05 16:00:09 2006 +0200 1.3 @@ -183,10 +183,15 @@ 1.4 void 1.5 resizecol(Arg *arg) 1.6 { 1.7 - Client *c = getnext(clients); 1.8 + unsigned int n; 1.9 + Client *c; 1.10 1.11 - if(!sel || !getnext(c->next) || (arrange != dotile)) 1.12 + for(n = 0, c = clients; c; c = c->next) 1.13 + if(isvisible(c) && !c->isfloat) 1.14 + n++; 1.15 + if(!sel || sel->isfloat || n < 2 || (arrange != dotile) || maximized) 1.16 return; 1.17 + 1.18 if(sel == getnext(clients)) { 1.19 if(mw + arg->i > sw - 100) 1.20 return; 1.21 @@ -303,12 +308,16 @@ 1.22 void 1.23 zoom(Arg *arg) 1.24 { 1.25 - Client *c = sel; 1.26 + unsigned int n; 1.27 + Client *c; 1.28 1.29 - if(!c || (arrange != dotile) || c->isfloat || maximized) 1.30 + for(n = 0, c = clients; c; c = c->next) 1.31 + if(isvisible(c) && !c->isfloat) 1.32 + n++; 1.33 + if(!sel || sel->isfloat || n < 2 || (arrange != dotile) || maximized) 1.34 return; 1.35 1.36 - if(c == getnext(clients)) 1.37 + if((c = sel) == getnext(clients)) 1.38 if(!(c = getnext(c->next))) 1.39 return; 1.40 detach(c);