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>
This commit is contained in:
Gatis Paeglis 2017-06-16 15:36:56 +02:00
parent 900abb116d
commit 214fc32981
3 changed files with 19 additions and 23 deletions

View File

@ -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) {

View File

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

View File

@ -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