aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorokan2020-03-20 15:16:31 +0000
committerWynn Wolf Arbor2020-03-26 20:12:46 +0100
commit4b38e940f174712ff633c3b7a8b4d619502ba119 (patch)
tree1aa841edf03403783e142a7ea629881f36f0145a
parent09a205710b3628ac3a7fe5a0b09ffe771ea56224 (diff)
downloadcwm-4b38e940f174712ff633c3b7a8b4d619502ba119.tar.gz
Trim event_mask to those that the root window actually needs.
-rw-r--r--screen.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/screen.c b/screen.c
index 70d3c98..2e55ac3 100644
--- a/screen.c
+++ b/screen.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: screen.c,v 1.95 2020/02/27 14:56:39 okan Exp $
+ * $OpenBSD: screen.c,v 1.96 2020/03/20 15:16:31 okan Exp $
*/
#include <sys/types.h>
@@ -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);