From 3cfdc17a10ab2ae1bb832373e8e9d9fba179800f Mon Sep 17 00:00:00 2001 From: Jeff Abrahamson Date: Thu, 2 Oct 2014 21:38:09 +0200 Subject: [PATCH 3/3] Do not propagate motion events: we only care when over the root window. Handling motion events on other windows does not lead to incorrect behavior, but it is inefficient, since we will always elect to discard the even, since the window was already focused by the EnterNotify that moved the mouse over the window. --- src/actions.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/actions.c b/src/actions.c index 1c5fc48..c56a5ff 100644 --- a/src/actions.c +++ b/src/actions.c @@ -1806,6 +1806,9 @@ read_frame (struct sbuf *s, struct cmdarg **arg) attr.border_pixel = screen->fg_color; attr.background_pixel = screen->bg_color; attr.override_redirect = True; + /* Do not propagate PointerMotion events, set in case the + user sets focus policy other than FOCUS_MANUAL. */ + attr.do_not_propagate_mask = PointerMotionMask; list_for_each_entry (cur, &screen->frames, node) { @@ -1822,7 +1825,7 @@ read_frame (struct sbuf *s, struct cmdarg **arg) /* Create and map the window. */ wins[i] = XCreateWindow (dpy, screen->root, screen->left + cur->x, screen->top + cur->y, width, height, 1, CopyFromParent, CopyFromParent, CopyFromParent, - CWOverrideRedirect | CWBorderPixel | CWBackPixel, + CWOverrideRedirect | CWBorderPixel | CWBackPixel | CWDontPropagate, &attr); XMapWindow (dpy, wins[i]); XClearWindow (dpy, wins[i]); -- 1.9.1