1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +01:00

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.
This commit is contained in:
Brad Jorsch
2010-04-26 13:56:36 -04:00
committed by Carlos R. Mafra
parent b575955263
commit 12d16d92e7

View File

@@ -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) {