diff options
author | oga <oga> | 2010-04-12 16:17:46 +0000 |
---|---|---|
committer | oga <oga> | 2010-04-12 16:17:46 +0000 |
commit | a292c96977547511316acc8e20798f7c2b1edb19 (patch) | |
tree | a969a07ae4ac2a3717b689bfe241fcd007f825ac | |
parent | b12e6fc5cdba5683832ddaace84150ff6cc507a8 (diff) | |
download | cwm-a292c96977547511316acc8e20798f7c2b1edb19.tar.gz cwm-a292c96977547511316acc8e20798f7c2b1edb19.tar.xz cwm-a292c96977547511316acc8e20798f7c2b1edb19.zip |
grab events on the root window *before* we look for existing windows.
This closes a race we were hitting often where stuff started right before cwm may not get noticed and not have borders. ok okan@. Prompted by something todd noticed.
-rw-r--r-- | calmwm.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/calmwm.c b/calmwm.c index 2b4fdd9..09e006f 100644 --- a/calmwm.c +++ b/calmwm.c @@ -176,6 +176,12 @@ x_setupscreen(struct screen_ctx *sc, u_int which) xu_setwmname(sc); + rootattr.event_mask = ChildMask|PropertyChangeMask|EnterWindowMask| + LeaveWindowMask|ColormapChangeMask|ButtonMask; + + XChangeWindowAttributes(X_Dpy, sc->rootwin, + CWEventMask, &rootattr); + /* Deal with existing clients. */ XQueryTree(X_Dpy, sc->rootwin, &w0, &w1, &wins, &nwins); @@ -190,12 +196,6 @@ x_setupscreen(struct screen_ctx *sc, u_int which) screen_updatestackingorder(sc); - rootattr.event_mask = ChildMask|PropertyChangeMask|EnterWindowMask| - LeaveWindowMask|ColormapChangeMask|ButtonMask; - - XChangeWindowAttributes(X_Dpy, sc->rootwin, - CWEventMask, &rootattr); - if (XineramaQueryExtension(X_Dpy, &fake, &fake) == 1 && ((HasXinerama = XineramaIsActive(X_Dpy)) == 1)) HasXinerama = 1; |