diff options
author | Gatis Paeglis <gatis.paeglis@qt.io> | 2017-06-16 15:36:56 +0200 |
---|---|---|
committer | Gatis Paeglis <gatis.paeglis@qt.io> | 2017-07-18 13:19:11 +0000 |
commit | 214fc329813d7c3375ec5d9e8f17de54d7ec42d3 (patch) | |
tree | ecdbd9a6b3732bb931eb1e53b6d54bd079fa8701 | |
parent | 900abb116d6f47e71bc2bdfa57553dd91786edf7 (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>
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.cpp | 10 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.h | 12 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 20 |
3 files changed, 19 insertions, 23 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index 91519c0e5e..1671bdabb2 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -2118,16 +2118,6 @@ void QXcbConnection::initializeXKB() #endif } -#if defined(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 && !has_xinerama_extension; -} -#endif - QXcbSystemTrayTracker *QXcbConnection::systemTrayTracker() const { if (!m_systemTrayTracker) { diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h index 15743c6328..6d13a1b82c 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -493,12 +493,15 @@ public: #ifdef XCB_USE_XINPUT21 void xi2UpdateScrollingDevices(); -#endif +#endif // XCB_USE_XINPUT21 #ifdef XCB_USE_XINPUT22 bool startSystemResizeForTouchBegin(xcb_window_t window, const QPoint &point, Qt::Corner corner); bool xi2SetMouseGrabEnabled(xcb_window_t w, bool grab); -#endif + bool xi2MouseEvents() const; + bool isTouchScreen(int id); +#endif // XCB_USE_XINPUT22 + Qt::MouseButton xiToQtMouseButton(uint32_t b); QXcbEventReader *eventReader() const { return m_reader; } @@ -507,11 +510,6 @@ public: QXcbGlIntegration *glIntegration() const { return m_glIntegration; } -#ifdef XCB_USE_XINPUT22 - bool xi2MouseEvents() const; - bool isTouchScreen(int id); -#endif - protected: bool event(QEvent *e) override; 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 |