about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@10kloc.org>2006-10-05 12:18:04 +0200
committerAnselm R. Garbe <arg@10kloc.org>2006-10-05 12:18:04 +0200
commit2583a7c0d18749c391a7149f2f1ffb3efd91ba8d (patch)
tree5b3903ca9b0999b029676066f52f386159abe22c
parent0ef6e3103c60510ebde09b74fb0f3590a641e6cc (diff)
downloaddwm-2583a7c0d18749c391a7149f2f1ffb3efd91ba8d.tar.gz
yet another simplification of dotile()
-rw-r--r--view.c55
1 files changed, 25 insertions, 30 deletions
diff --git a/view.c b/view.c
index 93a8c66..1bce54a 100644
--- a/view.c
+++ b/view.c
@@ -133,17 +133,15 @@ dotile(Arg *arg) {
 				continue;
 			}
 			c->ismax = False;
+			c->x = sx;
+			c->y = sy + bh;
 			if(n == 1) { /* only 1 window */
-				c->x = sx;
-				c->y = sy + bh;
 				c->w = sw - 2 * BORDERPX;
 				c->h = sh - 2 * BORDERPX - bh;
 			}
 			else if(i == 0) { /* master window */
-				c->x = sx;
 				if(stackpos == StackLeft)
 					c->x += stackw;
-				c->y = sy + bh;
 				switch(stackpos) {
 				case StackLeft:
 				case StackRight:
@@ -156,35 +154,32 @@ dotile(Arg *arg) {
 					break;
 				}
 			}
-			else if(th > bh) { /* tile window */
-				c->x = sx;
+			else {  /* tile window */
 				if(stackpos == StackRight)
 					c->x += master;
-				c->w = tw - 2 * BORDERPX;
-				c->h = th - 2 * BORDERPX;
-				switch(stackpos) {
-				case StackLeft:
-				case StackRight:
-					c->y = sy + (i - 1) * th + bh;
-					if(i + 1 == n)
-						c->h = sh - c->y - 2 * BORDERPX;
-					break;
-				case StackBottom:
-					c->y = sy + master + (i - 1) * th + bh;
-					if(i + 1 == n)
-						c->h = sh - c->y - 2 * BORDERPX;
-					break;
+				if(th > bh) {
+					switch(stackpos) {
+					case StackLeft:
+					case StackRight:
+						c->y = sy + (i - 1) * th + bh;
+						if(i + 1 == n)
+							c->h = sh - c->y - 2 * BORDERPX;
+						break;
+					case StackBottom:
+						c->y = sy + master + (i - 1) * th + bh;
+						if(i + 1 == n)
+							c->h = sh - c->y - 2 * BORDERPX;
+						break;
+					}
+					c->w = tw - 2 * BORDERPX;
+					c->h = th - 2 * BORDERPX;
+				}
+				else { /* fallback if th < bh */
+					if(stackpos == StackBottom)
+						c->y += master;
+					c->w = stackw - 2 * BORDERPX;
+					c->h = stackh - 2 * BORDERPX;
 				}
-			}
-			else { /* fallback if th < bh */
-				c->x = sx;
-				if(stackpos == StackRight)
-					c->x += master;
-				c->y = sy + bh;
-				if(stackpos == StackBottom)
-					c->y += master;
-				c->w = stackw - 2 * BORDERPX;
-				c->h = stackh - 2 * BORDERPX;
 			}
 			resize(c, False, TopLeft);
 			i++;
'author Anselm R. Garbe <garbeam@wmii.de> 2006-07-10 16:38:18 +0200 committer Anselm R. Garbe <garbeam@wmii.de> 2006-07-10 16:38:18 +0200 initial import' href='/acidbong/suckless/dwm/commit/wm.h?h=5.1&id=1076f2b6b3d3751d5d5db6fcb9ac8c247e04e893'>1076f2b
bf35794 ^
1076f2b
439e15d ^
bf35794 ^
1076f2b
7b5638f ^

c53980c ^
8b59083 ^
8b59083 ^


bf35794 ^

8b59083 ^

650a1fb ^
8b59083 ^
8b59083 ^


bf35794 ^


8b59083 ^

1076f2b
da2bbd3 ^

3399650 ^
1173723 ^

a05beb6 ^
2e836ec ^
a05beb6 ^
95e8d12 ^
901b3ed ^
4688ad1 ^
1076f2b
72707c2 ^
bf35794 ^

1076f2b

bf35794 ^

66da153 ^

bf35794 ^

efa7e51 ^
bf35794 ^


bf35794 ^
39677ec ^
439e15d ^
dba2306 ^
3399650 ^
adaa28a ^


dba2306 ^
adaa28a ^
c0705ee ^
adaa28a ^
dfd84f9 ^
adaa28a ^
04eb016 ^
adaa28a ^

4688ad1 ^
adaa28a ^

3399650 ^
d7e1708 ^
dba2306 ^
c0705ee ^
adaa28a ^
c0705ee ^

9e8b325 ^
d7e1708 ^
dba2306 ^
29355bd ^
b9da4b0 ^
9e8b325 ^
adaa28a ^
c47da14 ^
dba2306 ^
adaa28a ^
9e8b325 ^
dba2306 ^
adaa28a ^
dba2306 ^

937cabf ^
72707c2 ^
dba2306 ^
adaa28a ^
4688ad1 ^
adaa28a ^
1b63f83 ^

29355bd ^
8b59083 ^
8b59083 ^
adaa28a ^
c47da14 ^
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134