summary refs log tree commit diff
diff options
context:
space:
mode:
authorokan <okan>2020-03-20 15:16:31 +0000
committerokan <okan>2020-03-20 15:16:31 +0000
commit49f839e194b990dde123f35435c86cf5baa42c4d (patch)
tree01f41ba71df1c43b6c611e7a62a50a3ed93bdde1
parent207b71ef1ca478e81fa812e6a1a757e98ac9a344 (diff)
downloadcwm-49f839e194b990dde123f35435c86cf5baa42c4d.tar.gz
cwm-49f839e194b990dde123f35435c86cf5baa42c4d.tar.xz
cwm-49f839e194b990dde123f35435c86cf5baa42c4d.zip
Trim event_mask to those that the root window actually needs.
-rw-r--r--screen.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/screen.c b/screen.c
index 18acc35..b1e70e9 100644
--- a/screen.c
+++ b/screen.c
@@ -40,7 +40,7 @@ screen_init(int which)
 {
 	struct screen_ctx	*sc;
 	Window			active = None;
-	XSetWindowAttributes	 rootattr;
+	XSetWindowAttributes	 attr;
 
 	sc = xmalloc(sizeof(*sc));
 
@@ -69,20 +69,17 @@ screen_init(int which)
 	xu_ewmh_net_virtual_roots(sc);
 	active = xu_ewmh_get_net_active_window(sc);
 
-	rootattr.cursor = Conf.cursor[CF_NORMAL];
-	rootattr.event_mask = SubstructureRedirectMask |
-	    SubstructureNotifyMask | PropertyChangeMask | EnterWindowMask |
-	    LeaveWindowMask | ColormapChangeMask | BUTTONMASK;
+	attr.cursor = Conf.cursor[CF_NORMAL];
+	attr.event_mask = SubstructureRedirectMask | SubstructureNotifyMask |
+	    EnterWindowMask | PropertyChangeMask | ButtonPressMask;
+	XChangeWindowAttributes(X_Dpy, sc->rootwin, (CWEventMask | CWCursor), &attr);
 
-	XChangeWindowAttributes(X_Dpy, sc->rootwin,
-	    (CWEventMask | CWCursor), &rootattr);
+	if (Conf.xrandr)
+		XRRSelectInput(X_Dpy, sc->rootwin, RRScreenChangeNotifyMask);
 
 	screen_scan(sc, active);
 	screen_updatestackingorder(sc);
 
-	if (Conf.xrandr)
-		XRRSelectInput(X_Dpy, sc->rootwin, RRScreenChangeNotifyMask);
-
 	TAILQ_INSERT_TAIL(&Screenq, sc, entry);
 
 	XSync(X_Dpy, False);