move XUngrabServer to the end of client_new() to avoid races where clients,

such as those using sdl, attempt to manage the clients themselves when the
clients aren't fully ready.  other wm's grab the xserver during the whole
client setup process, so match.

behavior found by jsg.
This commit is contained in:
okan 2013-04-03 19:20:50 +00:00
parent fbb0df4155
commit ec4474a33a

View File

@ -121,9 +121,6 @@ client_new(Window win, struct screen_ctx *sc, int mapped)
(state == IconicState) ? client_hide(cc) : client_unhide(cc);
xu_setstate(cc, cc->state);
XSync(X_Dpy, False);
XUngrabServer(X_Dpy);
TAILQ_INSERT_TAIL(&sc->mruq, cc, mru_entry);
TAILQ_INSERT_TAIL(&Clientq, cc, entry);
@ -135,6 +132,9 @@ client_new(Window win, struct screen_ctx *sc, int mapped)
if (mapped)
group_autogroup(cc);
XSync(X_Dpy, False);
XUngrabServer(X_Dpy);
return (cc);
}