about summary refs log tree commit diff stats
path: root/dwm.c
diff options
context:
space:
mode:
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/dwm.c b/dwm.c
index e7804dc..50bbd6a 100644
--- a/dwm.c
+++ b/dwm.c
@@ -180,6 +180,7 @@ static void setclientstate(Client *c, long state);
 static void setlayout(const Arg *arg);
 static void setmfact(const Arg *arg);
 static void setup(void);
+static void showhide(Client *c);
 static void spawn(const Arg *arg);
 static void tag(const Arg *arg);
 static int textnw(const char *text, unsigned int len);
@@ -271,18 +272,8 @@ applyrules(Client *c) {
 
 void
 arrange(void) {
-	Client *c;
-
-	for(c = clients; c; c = c->next)
-		if(ISVISIBLE(c)) {
-			XMoveWindow(dpy, c->win, c->x, c->y);
-			if(!lt[sellt]->arrange || c->isfloating)
-				resize(c, c->x, c->y, c->w, c->h, True);
-		}
-		else {
-			XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
-		}
-
+	if(stack)
+		showhide(stack);
 	focus(NULL);
 	if(lt[sellt]->arrange)
 		lt[sellt]->arrange();
@@ -1377,6 +1368,19 @@ setup(void) {
 }
 
 void
+showhide(Client *c) {
+	if(ISVISIBLE(c)) { /* show clients top down */
+		XMoveWindow(dpy, c->win, c->x, c->y);
+		if(!lt[sellt]->arrange || c->isfloating)
+			resize(c, c->x, c->y, c->w, c->h, True);
+	}
+	if(c->snext) /* hide clients bottom up */
+		showhide(c->snext);
+	if(!ISVISIBLE(c))
+		XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
+}
+
+void
 spawn(const Arg *arg) {
 	/* The double-fork construct avoids zombie processes and keeps the code
 	 * clean from stupid signal handlers. */
='Blame the previous revision' href='/akkartik/mu/blame/html/013update_operation.cc.html?h=hlt&id=080e9cb73fa55cdc862f1dd7593df56e0a6302b8'>^
87c5b329 ^
9e751bb8 ^

e5c11a51 ^
4690ce81 ^
4a39d12d ^
a654e4ec ^
e5c11a51 ^
a654e4ec ^
4a39d12d ^
70f4e9b6 ^
9e751bb8 ^
76755b28 ^

a654e4ec ^



e5c11a51 ^






















a654e4ec ^

76755b28 ^
e5c11a51 ^
a654e4ec ^
204dae92 ^



201458e3 ^
204dae92 ^

201458e3 ^
c0f84b1f ^
204dae92 ^

2c678a4e ^
9e751bb8 ^


c0f84b1f ^
9e751bb8 ^



204dae92 ^



1c2d788b ^











76755b28 ^


a654e4ec ^
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