summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@suckless.org>2007-05-29 11:35:20 +0200
committerAnselm R. Garbe <arg@suckless.org>2007-05-29 11:35:20 +0200
commit199a6016114875656102d11e79a80939bfaff3b3 (patch)
tree2ad54798ecf25479959e50e611eb2163247745ec /client.c
parentapplied Sanders patch (diff)
downloaddwm-199a6016114875656102d11e79a80939bfaff3b3.tar.gz
dwm-199a6016114875656102d11e79a80939bfaff3b3.zip
applied anydot's 3 minor patches, thank you anydot
Diffstat (limited to '')
-rw-r--r--client.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/client.c b/client.c
index f3d31cb..90399ae 100644
--- a/client.c
+++ b/client.c
@@ -129,8 +129,8 @@ detach(Client *c) {
129 129
130void 130void
131focus(Client *c) { 131focus(Client *c) {
132 if(c && !isvisible(c)) 132 if( !c && selscreen || c && !isvisible(c))
133 return; 133 for(c = stack; c && !isvisible(c); c = c->snext);
134 if(sel && sel != c) { 134 if(sel && sel != c) {
135 grabbuttons(sel, False); 135 grabbuttons(sel, False);
136 XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]); 136 XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]);
@@ -153,14 +153,6 @@ focus(Client *c) {
153} 153}
154 154
155void 155void
156focustopvisible(void) {
157 Client *c;
158
159 for(c = stack; c && !isvisible(c); c = c->snext);
160 focus(c);
161}
162
163void
164killclient(const char *arg) { 156killclient(const char *arg) {
165 XEvent ev; 157 XEvent ev;
166 158
@@ -230,8 +222,7 @@ manage(Window w, XWindowAttributes *wa) {
230 XMoveWindow(dpy, w, c->x + 2 * sw, c->y); 222 XMoveWindow(dpy, w, c->x + 2 * sw, c->y);
231 XMapWindow(dpy, w); 223 XMapWindow(dpy, w);
232 setclientstate(c, NormalState); 224 setclientstate(c, NormalState);
233 if(isvisible(c)) 225 focus(c);
234 focus(c);
235 lt->arrange(); 226 lt->arrange();
236} 227}
237 228
@@ -401,7 +392,7 @@ unmanage(Client *c) {
401 detach(c); 392 detach(c);
402 detachstack(c); 393 detachstack(c);
403 if(sel == c) 394 if(sel == c)
404 focustopvisible(); 395 focus(NULL);
405 XUngrabButton(dpy, AnyButton, AnyModifier, c->win); 396 XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
406 setclientstate(c, WithdrawnState); 397 setclientstate(c, WithdrawnState);
407 free(c->tags); 398 free(c->tags);