about summary refs log tree commit diff stats
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
parent3a1343a2458aa53d50019f24a32a3ab9bb8b3a83 (diff)
downloaddwm-ec85fddb9a3a93a216b779cc39fead1a3d90aafd.tar.gz
applied checking existance of >2 tiles patch (proposed by sander) to zoom and resizecol
-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);
;id=a58731e8355a1dd85df1275fe851c7a48648a162'>^
3794c62 ^

f196b71 ^


04dec4c ^
338c083 ^
f196b71 ^



3794c62 ^
f196b71 ^
2d81b78 ^
3794c62 ^
04dec4c ^
3794c62 ^

338c083 ^
3794c62 ^
ae760f3 ^
f6e41b0 ^
e461e60 ^
3794c62 ^
f196b71 ^

b515765 ^
04dec4c ^
19dcbc5 ^
2c477cf ^
0ea0343 ^
2c477cf ^
2aef8b9 ^
10bc0ce ^

a923298 ^

2c477cf ^

338c083 ^
2c477cf ^

10bc0ce ^

















2c477cf ^
10bc0ce ^

















2c477cf ^
b515765 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95