X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=view.c;h=587c53a9258c1d028bc0caa2c2e9d33fe3210d28;hb=0ed0fa4d5b3d5f0215c76563dbb72475eed1f3e8;hp=f1be60925791b8c8f70f413cf20141a67a1786fe;hpb=c7ae6334b7f0e8ac1fbc4da977fef4b92792767b;p=dwm.git diff --git a/view.c b/view.c index f1be609..587c53a 100644 --- a/view.c +++ b/view.c @@ -169,11 +169,29 @@ focusprev(Arg *arg) } } +Bool +isvisible(Client *c) +{ + unsigned int i; + + for(i = 0; i < ntags; i++) + if(c->tags[i] && seltag[i]) + return True; + return False; +} + void -growcol(Arg *arg) +resizecol(Arg *arg) { - if(!sel || !clients || !clients->next || (arrange != dotile)) + unsigned int n; + Client *c; + + for(n = 0, c = clients; c; c = c->next) + if(isvisible(c) && !c->isfloat) + n++; + if(!sel || sel->isfloat || n < 2 || (arrange != dotile) || maximized) return; + if(sel == getnext(clients)) { if(mw + arg->i > sw - 100) return; @@ -187,17 +205,6 @@ growcol(Arg *arg) arrange(NULL); } -Bool -isvisible(Client *c) -{ - unsigned int i; - - for(i = 0; i < ntags; i++) - if(c->tags[i] && seltag[i]) - return True; - return False; -} - void restack() { @@ -301,12 +308,16 @@ viewall(Arg *arg) void zoom(Arg *arg) { - Client *c = sel; + unsigned int n; + Client *c; - if(!c || (arrange != dotile) || c->isfloat || maximized) + for(n = 0, c = clients; c; c = c->next) + if(isvisible(c) && !c->isfloat) + n++; + if(!sel || sel->isfloat || n < 2 || (arrange != dotile) || maximized) return; - if(c == getnext(clients)) + if((c = sel) == getnext(clients)) if(!(c = getnext(c->next))) return; detach(c);