summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
diff options
context:
space:
mode:
authorGatis Paeglis <gatis.paeglis@qt.io>2017-06-16 15:36:56 +0200
committerGatis Paeglis <gatis.paeglis@qt.io>2017-07-18 13:19:11 +0000
commit214fc329813d7c3375ec5d9e8f17de54d7ec42d3 (patch)
treeecdbd9a6b3732bb931eb1e53b6d54bd079fa8701 /src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
parent900abb116d6f47e71bc2bdfa57553dd91786edf7 (diff)
xcb: fix build failure when XCB_USE_XINPUT22 is not defined
... and group XI22 methods together under one ifdef clause. The error message was: qxcbconnection_xi2.cpp:1025:42: error: no ‘bool QXcbConnection::isTouchScreen(int)’ member function declared in class ‘QXcbConnection’ bool QXcbConnection::isTouchScreen(int id) XInput 2.2 was released many years ago, this build failure could in practice happen only on some really old platform. Change-Id: I3c1741cbdffe15c0f5149c6d76592a743d1d8a91 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection_xi2.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection_xi2.cpp20
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