summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-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) {
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
156killclient(const char *arg) { 164killclient(const char *arg) {
157 XEvent ev; 165 XEvent ev;
158 166
@@ -391,10 +399,8 @@ unmanage(Client *c) {
391 XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); /* restore border */ 399 XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); /* restore border */
392 detach(c); 400 detach(c);
393 detachstack(c); 401 detachstack(c);
394 if(sel == c) { 402 if(sel == c)
395 for(nc = stack; nc && !isvisible(nc); nc = nc->snext); 403 focustopvisible();
396 focus(nc);
397 }
398 XUngrabButton(dpy, AnyButton, AnyModifier, c->win); 404 XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
399 setclientstate(c, WithdrawnState); 405 setclientstate(c, WithdrawnState);
400 free(c->tags); 406 free(c->tags);