diff options
Diffstat (limited to 'client.c')
| -rw-r--r-- | client.c | 14 |
1 files changed, 10 insertions, 4 deletions
| @@ -153,6 +153,14 @@ focus(Client *c) { | |||
| 153 | } | 153 | } |
| 154 | 154 | ||
| 155 | void | 155 | void |
| 156 | focustopvisible(void) { | ||
| 157 | Client *c; | ||
| 158 | |||
| 159 | for(c = stack; c && !isvisible(c); c = c->snext); | ||
| 160 | focus(c); | ||
| 161 | } | ||
| 162 | |||
| 163 | void | ||
| 156 | killclient(const char *arg) { | 164 | killclient(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); |
