diff options
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection_xi2.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp index a4be0371fd..9236d98abf 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp @@ -591,6 +591,20 @@ void QXcbConnection::xi2HandleEvent(xcb_ge_event_t *event) } #ifdef XCB_USE_XINPUT22 +bool QXcbConnection::xi2MouseEvents() const +{ + static bool mouseViaXI2 = !qEnvironmentVariableIsSet("QT_XCB_NO_XI2_MOUSE"); + // FIXME: Don't use XInput2 mouse events when Xinerama extension + // is enabled, because it causes problems with multi-monitor setup. + return mouseViaXI2 && isAtLeastXI22() && !has_xinerama_extension; +} + +bool QXcbConnection::isTouchScreen(int id) +{ + auto device = touchDeviceForId(id); + return device && device->qtTouchDevice->type() == QTouchDevice::TouchScreen; +} + void QXcbConnection::xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow) { xXIDeviceEvent *xiDeviceEvent = static_cast<xXIDeviceEvent *>(xiDevEvent); @@ -1061,12 +1075,6 @@ Qt::MouseButton QXcbConnection::xiToQtMouseButton(uint32_t b) return Qt::NoButton; } -bool QXcbConnection::isTouchScreen(int id) -{ - auto device = touchDeviceForId(id); - return device && device->qtTouchDevice->type() == QTouchDevice::TouchScreen; -} - #if QT_CONFIG(tabletevent) static QTabletEvent::TabletDevice toolIdToTabletDevice(quint32 toolId) { // keep in sync with wacom_intuos_inout() in Linux kernel driver wacom_wac.c |