diff options
author | Gatis Paeglis <gatis.paeglis@theqtcompany.com> | 2016-02-01 14:06:16 +0100 |
---|---|---|
committer | Gatis Paeglis <gatis.paeglis@theqtcompany.com> | 2016-02-01 14:39:36 +0000 |
commit | ed2e15780385f7cf0a0d3aedc9cb2059d470bd58 (patch) | |
tree | 948025bb5d0c3060ba874d0cc8c7636bc409a778 /src/plugins/platforms | |
parent | ad77422e824df3556984b793d5b304a87d7c757b (diff) |
xcb: Ignore Mouse Enter:ungrab, Leave:grab events.
These are "special" XCB_NOTIFY_MODE_(UN)GRAB
Enter/Leave events and we do not have handlers for
them in Qt, so lets just ignore events with this mode.
Patch fixes Qt+ArchLinux+Awesome WM issues, where Qt
applications were receiving Enter/Leave events for
mouse clicks in the application window.
This patch does not affect "normal" XCB_NOTIFY_MODE_NORMAL
Enter/Leave event handling.
Task-number: QTBUG-45818
Change-Id: Ib70fdd9ed9200364a9753904f8e63d1ed9e2072f
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindow.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index c6eb5aa66b..f97f570831 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -2251,12 +2251,13 @@ void QXcbWindow::handleMouseEvent(xcb_timestamp_t time, const QPoint &local, con static bool ignoreLeaveEvent(const xcb_leave_notify_event_t *event) { return event->detail == XCB_NOTIFY_DETAIL_VIRTUAL - || event->detail == XCB_NOTIFY_DETAIL_NONLINEAR_VIRTUAL; + || event->detail == XCB_NOTIFY_DETAIL_NONLINEAR_VIRTUAL + || event->mode == XCB_NOTIFY_MODE_GRAB; } static bool ignoreEnterEvent(const xcb_enter_notify_event_t *event) { - return ((event->mode != XCB_NOTIFY_MODE_NORMAL && event->mode != XCB_NOTIFY_MODE_UNGRAB) + return (event->mode != XCB_NOTIFY_MODE_NORMAL || event->detail == XCB_NOTIFY_DETAIL_VIRTUAL || event->detail == XCB_NOTIFY_DETAIL_NONLINEAR_VIRTUAL); } |