diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2013-08-15 14:12:01 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-16 16:23:17 +0200 |
commit | 6281acaf8f5cd11a7fa6eb40da68b4707a41e148 (patch) | |
tree | f7500da88d40ec176b1b86c13119b77ecfc9a49c /src/plugins | |
parent | e72785547696146f6172f0ef2824033e17df7b50 (diff) |
XI2 touch support: must call deviceForId to create the device
After change 4dbf574b7acb7ae8f852219700afa95f8d568f0e touch worked
only if XI2_DEBUG is turned on. That is because it creates the
QTouchDevice and calls QWindowSystemInterface::registerTouchDevice,
which must be done at startup so we can receive events.
Change-Id: I9446d72bc702fbd819bf26bcdc2a3d657180f642
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp index 466193b7a1..ee1fe44530 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp @@ -141,9 +141,9 @@ void QXcbConnection::initializeXInput2() #endif } #endif // QT_NO_TABLETEVENT -#ifdef XI2_DEBUG if (!isTablet) { XInput2DeviceData *dev = deviceForId(devices[i].deviceid); +#ifdef XI2_DEBUG if (dev && dev->qtTouchDevice->type() == QTouchDevice::TouchScreen) qDebug(" it's a touchscreen with type %d capabilities 0x%X max touch points %d", dev->qtTouchDevice->type(), (unsigned int)dev->qtTouchDevice->capabilities(), @@ -153,8 +153,10 @@ void QXcbConnection::initializeXInput2() dev->qtTouchDevice->type(), (unsigned int)dev->qtTouchDevice->capabilities(), dev->qtTouchDevice->maximumTouchPoints(), dev->size.width(), dev->size.height()); - } +#else + Q_UNUSED(dev); #endif // XI2_DEBUG + } } XIFreeDeviceInfo(devices); } |