summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'client.c')
-rw-r--r--client.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/client.c b/client.c
index 49229a7..6524c06 100644
--- a/client.c
+++ b/client.c
@@ -414,14 +414,16 @@ togglemax(Arg *arg)
414void 414void
415unmanage(Client *c) 415unmanage(Client *c)
416{ 416{
417 Client *nc;
418
417 XGrabServer(dpy); 419 XGrabServer(dpy);
418 XSetErrorHandler(xerrordummy); 420 XSetErrorHandler(xerrordummy);
419 421
420 detach(c); 422 detach(c);
421 detachstack(c); 423 detachstack(c);
422 if(sel == c) { 424 if(sel == c) {
423 for(sel = stack; sel && !isvisible(sel); sel = sel->snext); 425 for(nc = stack; nc && !isvisible(nc); nc = nc->snext);
424 focus(sel); 426 focus(nc);
425 } 427 }
426 428
427 XUngrabButton(dpy, AnyButton, AnyModifier, c->win); 429 XUngrabButton(dpy, AnyButton, AnyModifier, c->win);