X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=client.c;h=6524c06054302149d732f9d8a174332764713398;hb=0925dd588c6879916c8a9ded1e680963b093b068;hp=49229a798d04141e7d2c4be38c780302a80d0c96;hpb=2e68f22118438fed885c8cc3ccb8be94437eb327;p=dwm.git 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) 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);