about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@suckless.org>2007-01-23 12:00:49 +0100
committerAnselm R. Garbe <arg@suckless.org>2007-01-23 12:00:49 +0100
commit17ec726b494c2ee6e6b5dbe00bb83b2d931b3fc0 (patch)
treed42812e3d2cc53d435abc200b0aa77a7ba331895
parent373b11de11fd5cee875ef521e3ac0527565c4721 (diff)
downloaddwm-17ec726b494c2ee6e6b5dbe00bb83b2d931b3fc0.tar.gz
this version should also work with cornercases (like unmanage during !issel, etc.)
-rw-r--r--client.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/client.c b/client.c
index 5309d0e..5c69718 100644
--- a/client.c
+++ b/client.c
@@ -79,15 +79,16 @@ configure(Client *c) {
 
 void
 focus(Client *c) {
-	Client *old = sel;
-
 	if(c && !isvisible(c))
 		return;
 
-	if(old && old != c) {
-		grabbuttons(old, False);
-		XSetWindowBorder(dpy, old->win, dc.norm[ColBorder]);
+	if(sel && sel != c) {
+		grabbuttons(sel, False);
+		XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]);
 	}
+	sel = c;
+	if(!issel)
+		return;
 	if(c) {
 		detachstack(c);
 		c->snext = stack;
@@ -96,9 +97,8 @@ focus(Client *c) {
 		XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]);
 		XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
 	}
-	else if(issel)
+	else
 		XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
-	sel = c;
 	drawstatus();
 }
 
h <boothj5@gmail.com> 2012-10-03 23:47:10 +0100 committer James Booth <boothj5@gmail.com> 2012-10-03 23:47:10 +0100 Started work on chat session, and chat states' href='/danisanti/profani-tty/commit/src/chat_session.c?id=f8de28232e353794617e402dc0ebf05b57728cc5'>f8de2823 ^
5792cd59 ^
93bcd4af ^
5ce97728 ^
5ce97728 ^


5792cd59 ^

5ce97728 ^



0f751966 ^
a50d1ece ^
0f751966 ^
894360dc ^
5ce97728 ^


0f751966 ^
306f00d3 ^
f8de2823 ^

e75b8dcf ^


0f751966 ^
306f00d3 ^
f8de2823 ^
d339004f ^
f8de2823 ^
d339004f ^
f8de2823 ^


5b859927 ^
d339004f ^

0f0e0460 ^

d339004f ^

a50d1ece ^
894360dc ^
270ac035 ^
0f751966 ^
a50d1ece ^
894360dc ^

270ac035 ^


a50d1ece ^

270ac035 ^

10a3a3a6 ^
e75b8dcf ^
5ce97728 ^
e75b8dcf ^
5ce97728 ^
921f026c ^
5792cd59 ^



5ce97728 ^



10a3a3a6 ^
e75b8dcf ^
5792cd59 ^
e75b8dcf ^
5792cd59 ^
921f026c ^
5792cd59 ^
4be7833e ^
270ac035 ^
5792cd59 ^


ac4b59ed ^




894360dc ^


a50d1ece ^

ac4b59ed ^
894360dc ^
10a3a3a6 ^
ac4b59ed ^






671ee0b8 ^
894360dc ^
fe2ef44c ^
894360dc ^


a50d1ece ^
fe2ef44c ^
894360dc ^
fe2ef44c ^



671ee0b8 ^


894360dc ^


a50d1ece ^
10a3a3a6 ^







894360dc ^
10a3a3a6 ^
894360dc ^

10a3a3a6 ^
894360dc ^

10a3a3a6 ^






894360dc ^




10a3a3a6 ^





894360dc ^







10a3a3a6 ^






894360dc ^



10a3a3a6 ^
894360dc ^




10a3a3a6 ^
894360dc ^




10a3a3a6 ^
894360dc ^



10a3a3a6 ^



894360dc ^










671ee0b8 ^



f8de2823 ^
0f751966 ^
f8de2823 ^
5b859927 ^
a50d1ece ^
5ce97728 ^



9e092843 ^
f8de2823 ^
ac4b59ed ^
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
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
264
265
266