about summary refs log tree commit diff stats
path: root/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'client.c')
-rw-r--r--client.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/client.c b/client.c
index 3db14f5..72e5c32 100644
--- a/client.c
+++ b/client.c
@@ -153,6 +153,14 @@ focus(Client *c) {
 }
 
 void
+focustopvisible(void) {
+	Client *c;
+
+	for(c = stack; c && !isvisible(c); c = c->snext);
+	focus(c);
+}
+
+void
 killclient(const char *arg) {
 	XEvent ev;
 
@@ -391,10 +399,8 @@ unmanage(Client *c) {
 	XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); /* restore border */
 	detach(c);
 	detachstack(c);
-	if(sel == c) {
-		for(nc = stack; nc && !isvisible(nc); nc = nc->snext);
-		focus(nc);
-	}
+	if(sel == c)
+		focustopvisible();
 	XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
 	setclientstate(c, WithdrawnState);
 	free(c->tags);
7:11:58 -0800 2614 - still fixing bugs with missing '['' href='/akkartik/mu/commit/055parse_tree.cc?h=hlt&id=1f7e3c056ce0ea71e1337579b24e8fd1ad26abac'>1f7e3c05 ^
08cf048f ^
a17f9186 ^




6808ff7d ^

a17f9186 ^

6808ff7d ^


08cf048f ^
6808ff7d ^
1f7e3c05 ^
6808ff7d ^




a17f9186 ^
6808ff7d ^

a17f9186 ^
6808ff7d ^

9cfd925a ^
1ead3562 ^
15f79a66 ^
6808ff7d ^
15f79a66 ^




acc4792d ^
ff8d96ae ^
69e418d7 ^
1ead3562 ^
b0bf5321 ^




69e418d7 ^



ff8d96ae ^


1ead3562 ^
b0bf5321 ^
ff8d96ae ^
8a3d101e ^
ff8d96ae ^
bb33c5e8 ^
c4e143d6 ^





ff8d96ae ^

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