From 282d00dd063bedb53871f1b8a3dd09c3d4edc55f Mon Sep 17 00:00:00 2001 From: oga Date: Mon, 12 Apr 2010 16:17:46 +0000 Subject: 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. --- calmwm.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/calmwm.c b/calmwm.c index 17d283a..8744ee9 100644 --- a/calmwm.c +++ b/calmwm.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. * - * $Id: calmwm.c,v 1.52 2010/01/27 03:04:50 okan Exp $ + * $Id: calmwm.c,v 1.53 2010/04/12 16:17:46 oga Exp $ */ #include @@ -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; -- cgit v1.2.3-2-gb3c3