mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
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:
6
client.c
6
client.c
@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user