From 12d16d92e74b3293274ddbfa004308e332bc639d Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Mon, 26 Apr 2010 13:56:36 -0400 Subject: [PATCH] Fix mouse button grab swallowing We grab Mod+Button events for our own purposes, and swallow them using XAllowEvents(AsyncPointer) to prevent the client window from seeing them. But if events are coming in fast enough (e.g. via fast wheel scrolling) so that multiple grabbed events are in the queue, the second queued event would be allowed to leak through to the client by the unconditional XAllowEvents(ReplayPointer) a few lines later. --- src/event.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/event.c b/src/event.c index 2690fbb6..4f1287c5 100644 --- a/src/event.c +++ b/src/event.c @@ -767,14 +767,14 @@ static void handleButtonPress(XEvent * event) if (event->xbutton.state & ( MOD_MASK | ControlMask )) { XAllowEvents(dpy, AsyncPointer, CurrentTime); + } else { + /* if (wPreferences.focus_mode == WKF_CLICK) { */ + if (wPreferences.ignore_focus_click) { + XAllowEvents(dpy, AsyncPointer, CurrentTime); + } + XAllowEvents(dpy, ReplayPointer, CurrentTime); + /* } */ } - - /* if (wPreferences.focus_mode == WKF_CLICK) { */ - if (wPreferences.ignore_focus_click) { - XAllowEvents(dpy, AsyncPointer, CurrentTime); - } - XAllowEvents(dpy, ReplayPointer, CurrentTime); - /* } */ XSync(dpy, 0); } else if (desc->parent_type == WCLASS_APPICON || desc->parent_type == WCLASS_MINIWINDOW || desc->parent_type == WCLASS_DOCK_ICON) {