# HG changeset patch # User Anselm R. Garbe # Date 1157696394 -7200 # Node ID 728c9089b079721b43c3347124639a29baa22a97 # Parent 78d36a1dd1d96bfdf853bbdb814bb40e323c3a85 applied sanders patch of not manipulating sel diff -r 78d36a1dd1d9 -r 728c9089b079 client.c --- a/client.c Fri Sep 08 07:40:16 2006 +0200 +++ b/client.c Fri Sep 08 08:19:54 2006 +0200 @@ -414,14 +414,16 @@ void unmanage(Client *c) { + Client *nc; + XGrabServer(dpy); XSetErrorHandler(xerrordummy); detach(c); detachstack(c); if(sel == c) { - for(sel = stack; sel && !isvisible(sel); sel = sel->snext); - focus(sel); + for(nc = stack; nc && !isvisible(nc); nc = nc->snext); + focus(nc); } XUngrabButton(dpy, AnyButton, AnyModifier, c->win); diff -r 78d36a1dd1d9 -r 728c9089b079 view.c --- a/view.c Fri Sep 08 07:40:16 2006 +0200 +++ b/view.c Fri Sep 08 08:19:54 2006 +0200 @@ -77,8 +77,8 @@ ban(c); } if(!sel || !isvisible(sel)) { - for(sel = stack; sel && !isvisible(sel); sel = sel->snext); - focus(sel); + for(c = stack; c && !isvisible(c); c = c->snext); + focus(c); } restack(); } @@ -141,8 +141,8 @@ ban(c); } if(!sel || !isvisible(sel)) { - for(sel = stack; sel && !isvisible(sel); sel = sel->snext); - focus(sel); + for(c = stack; c && !isvisible(c); c = c->snext); + focus(c); } restack(); }