Fix Wacom Art Pen detection on xcb

Fixes: QTBUG-91102
Change-Id: I6cd7af26153457609c1fa8fb0a9e167939d592fc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Shawn Rutledge 2021-02-12 09:54:28 +01:00
parent 95712c5e54
commit bfa78aedc0
3 changed files with 10 additions and 4 deletions

View File

@ -324,14 +324,16 @@ const QPointingDevice *QPointingDevice::primaryPointingDevice(const QString& sea
If an instance matching the given \a deviceType and \a pointerType but with If an instance matching the given \a deviceType and \a pointerType but with
only a default-constructed \c uniqueId is found, it will be assumed to be only a default-constructed \c uniqueId is found, it will be assumed to be
the one we're looking for, and its \c uniqueId will be updated to match the the one we're looking for, its \c uniqueId will be updated to match the
given \a uniqueId. This is for the benefit of any platform plugin that can given \a uniqueId, and its \c capabilities will be updated to match the
given \a capabilities. This is for the benefit of any platform plugin that can
discover the tablet itself at startup, along with the supported stylus types, discover the tablet itself at startup, along with the supported stylus types,
but then discovers specific styli later on as they come into proximity. but then discovers specific styli later on as they come into proximity.
*/ */
const QPointingDevice *QPointingDevicePrivate::queryTabletDevice(QInputDevice::DeviceType deviceType, const QPointingDevice *QPointingDevicePrivate::queryTabletDevice(QInputDevice::DeviceType deviceType,
QPointingDevice::PointerType pointerType, QPointingDevice::PointerType pointerType,
QPointingDeviceUniqueId uniqueId, QPointingDeviceUniqueId uniqueId,
QPointingDevice::Capabilities capabilities,
qint64 systemId) qint64 systemId)
{ {
const auto &devices = QInputDevice::devices(); const auto &devices = QInputDevice::devices();
@ -346,7 +348,9 @@ const QPointingDevice *QPointingDevicePrivate::queryTabletDevice(QInputDevice::D
(devPriv->uniqueId == uniqueId || uniqueIdDiscovered)) { (devPriv->uniqueId == uniqueId || uniqueIdDiscovered)) {
if (uniqueIdDiscovered) { if (uniqueIdDiscovered) {
const_cast<QPointingDevicePrivate *>(devPriv)->uniqueId = uniqueId; const_cast<QPointingDevicePrivate *>(devPriv)->uniqueId = uniqueId;
qCDebug(lcQpaInputDevices) << "discovered unique ID of tablet tool" << pdev; if (capabilities)
const_cast<QPointingDevicePrivate *>(devPriv)->capabilities = capabilities;
qCDebug(lcQpaInputDevices) << "discovered unique ID and capabilities of tablet tool" << pdev;
} }
return pdev; return pdev;
} }

View File

@ -131,6 +131,7 @@ public:
static const QPointingDevice *queryTabletDevice(QInputDevice::DeviceType deviceType, static const QPointingDevice *queryTabletDevice(QInputDevice::DeviceType deviceType,
QPointingDevice::PointerType pointerType, QPointingDevice::PointerType pointerType,
QPointingDeviceUniqueId uniqueId, QPointingDeviceUniqueId uniqueId,
QInputDevice::Capabilities capabilities = QInputDevice::Capability::None,
qint64 systemId = 0); qint64 systemId = 0);
static const QPointingDevice *pointingDeviceById(qint64 systemId); static const QPointingDevice *pointingDeviceById(qint64 systemId);

View File

@ -204,7 +204,8 @@ static const QPointingDevice *tabletToolInstance(QPointingDevice *master, const
if (pointerTypeOverride != QPointingDevice::PointerType::Unknown) if (pointerTypeOverride != QPointingDevice::PointerType::Unknown)
pointerType = pointerTypeOverride; pointerType = pointerTypeOverride;
const QPointingDevice *ret = QPointingDevicePrivate::queryTabletDevice(devType, pointerType, const QPointingDevice *ret = QPointingDevicePrivate::queryTabletDevice(devType, pointerType,
QPointingDeviceUniqueId::fromNumericId(uniqueId), id); QPointingDeviceUniqueId::fromNumericId(uniqueId),
caps, id);
if (!ret) { if (!ret) {
ret = new QPointingDevice(tabletName, id, devType, pointerType, caps, 1, buttonCount, ret = new QPointingDevice(tabletName, id, devType, pointerType, caps, 1, buttonCount,
master ? master->seatName() : QString(), master ? master->seatName() : QString(),