summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--client.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/client.c b/client.c
index 3578beb..71ef677 100644
--- a/client.c
+++ b/client.c
@@ -414,19 +414,13 @@ togglemax(Arg *arg)
414void 414void
415unmanage(Client *c) 415unmanage(Client *c)
416{ 416{
417 Client *tc, *fc;
418 Window trans;
419 XGrabServer(dpy); 417 XGrabServer(dpy);
420 XSetErrorHandler(xerrordummy); 418 XSetErrorHandler(xerrordummy);
421 419
422 detach(c); 420 detach(c);
423 if(sel == c) { 421 if(sel == c) {
424 XGetTransientForHint(dpy, c->win, &trans); 422 for(sel = stack; sel && !isvisible(sel); sel = sel->snext);
425 if(trans && (tc = getclient(trans)) && isvisible(tc)) 423 focus(sel);
426 fc = tc;
427 else
428 fc = getnext(clients);
429 focus(fc);
430 } 424 }
431 425
432 XUngrabButton(dpy, AnyButton, AnyModifier, c->win); 426 XUngrabButton(dpy, AnyButton, AnyModifier, c->win);