diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2013-04-03 19:20:51 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2013-04-03 19:20:51 +0000 |
commit | 9b8ef34cc756b863f09597ca971cb0516d5d6d5e (patch) | |
tree | 6bb3913709b33e43aed6dce39608cca94f7d20e8 /app | |
parent | 54e43a93dbb25bd5d22e54fb69a4f05ee3e4da11 (diff) |
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.
Diffstat (limited to 'app')
-rw-r--r-- | app/cwm/client.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/cwm/client.c b/app/cwm/client.c index 9845a3228..96f63f405 100644 --- a/app/cwm/client.c +++ b/app/cwm/client.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: client.c,v 1.119 2013/01/08 15:16:05 okan Exp $ + * $OpenBSD: client.c,v 1.120 2013/04/03 19:20:50 okan Exp $ */ #include <sys/param.h> @@ -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); } |