about summary refs log tree commit diff stats
path: root/view.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@10kloc.org>2006-09-05 16:00:09 +0200
committerAnselm R. Garbe <arg@10kloc.org>2006-09-05 16:00:09 +0200
commitec85fddb9a3a93a216b779cc39fead1a3d90aafd (patch)
tree318402a2be60948de224afe5ae133871b906b5e9 /view.c
parent3a1343a2458aa53d50019f24a32a3ab9bb8b3a83 (diff)
downloaddwm-ec85fddb9a3a93a216b779cc39fead1a3d90aafd.tar.gz
applied checking existance of >2 tiles patch (proposed by sander) to zoom and resizecol
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);
8 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263