about summary refs log tree commit diff stats
path: root/view.c
diff options
context:
space:
mode:
Diffstat (limited to 'view.c')
-rw-r--r--view.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/view.c b/view.c
index 4b4c9eb..587c53a 100644
--- a/view.c
+++ b/view.c
@@ -183,10 +183,15 @@ isvisible(Client *c)
 void
 resizecol(Arg *arg)
 {
-	Client *c = getnext(clients);
+	unsigned int n;
+	Client *c;
 
-	if(!sel || !getnext(c->next) || (arrange != dotile))
+	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;
@@ -303,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);
0 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194