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>
bb10
Gatis Paeglis 2016-02-01 14:06:16 +01:00
parent ad77422e82
commit ed2e157803
1 changed files with 3 additions and 2 deletions

View File

@ -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);
}