XI2 touch support: must call deviceForId to create the device

After change 4dbf574b7a 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>
This commit is contained in:
Shawn Rutledge 2013-08-15 14:12:01 +02:00 committed by The Qt Project
parent e727855476
commit 6281acaf8f

View File

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