summaryrefslogtreecommitdiff
path: root/app/cwm/calmwm.c
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2010-04-12 16:17:47 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2010-04-12 16:17:47 +0000
commit314d577cc84a94851dceacf6cdbfca573a81f509 (patch)
tree8f0a5e89f9920c0754d539b5fb0511c786076cc7 /app/cwm/calmwm.c
parent858a9d1adc1b0d221499c9b91e7d7bb015f23301 (diff)
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.
Diffstat (limited to 'app/cwm/calmwm.c')
-rw-r--r--app/cwm/calmwm.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/app/cwm/calmwm.c b/app/cwm/calmwm.c
index 17d283a67..8744ee981 100644
--- a/app/cwm/calmwm.c
+++ b/app/cwm/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 <sys/param.h>
@@ -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;