From 6281acaf8f5cd11a7fa6eb40da68b4707a41e148 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Thu, 15 Aug 2013 14:12:01 +0200 Subject: 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 --- src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 6 ++++-- 1 file 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); } -- cgit v1.2.3