summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2021-02-12 09:54:28 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2021-02-12 18:25:51 +0100
commitbfa78aedc089712a2c21225b63bd58ec12d2e926 (patch)
tree7b3f3fbbf325861dfa382482b2c904029c2b50d4 /src/gui
parent95712c5e5438e4eb5cd205ab4659febf3192137a (diff)
Fix Wacom Art Pen detection on xcb
Fixes: QTBUG-91102 Change-Id: I6cd7af26153457609c1fa8fb0a9e167939d592fc Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qpointingdevice.cpp10
-rw-r--r--src/gui/kernel/qpointingdevice_p.h1
2 files changed, 8 insertions, 3 deletions
diff --git a/src/gui/kernel/qpointingdevice.cpp b/src/gui/kernel/qpointingdevice.cpp
index 6ef032098f..176a5fedf4 100644
--- a/src/gui/kernel/qpointingdevice.cpp
+++ b/src/gui/kernel/qpointingdevice.cpp
@@ -324,14 +324,16 @@ const QPointingDevice *QPointingDevice::primaryPointingDevice(const QString& sea
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
- the one we're looking for, and its \c uniqueId will be updated to match the
- given \a uniqueId. This is for the benefit of any platform plugin that can
+ the one we're looking for, its \c uniqueId will be updated to match the
+ 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,
but then discovers specific styli later on as they come into proximity.
*/
const QPointingDevice *QPointingDevicePrivate::queryTabletDevice(QInputDevice::DeviceType deviceType,
QPointingDevice::PointerType pointerType,
QPointingDeviceUniqueId uniqueId,
+ QPointingDevice::Capabilities capabilities,
qint64 systemId)
{
const auto &devices = QInputDevice::devices();
@@ -346,7 +348,9 @@ const QPointingDevice *QPointingDevicePrivate::queryTabletDevice(QInputDevice::D
(devPriv->uniqueId == uniqueId || uniqueIdDiscovered)) {
if (uniqueIdDiscovered) {
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;
}
diff --git a/src/gui/kernel/qpointingdevice_p.h b/src/gui/kernel/qpointingdevice_p.h
index 645c82673b..04823a3e86 100644
--- a/src/gui/kernel/qpointingdevice_p.h
+++ b/src/gui/kernel/qpointingdevice_p.h
@@ -131,6 +131,7 @@ public:
static const QPointingDevice *queryTabletDevice(QInputDevice::DeviceType deviceType,
QPointingDevice::PointerType pointerType,
QPointingDeviceUniqueId uniqueId,
+ QInputDevice::Capabilities capabilities = QInputDevice::Capability::None,
qint64 systemId = 0);
static const QPointingDevice *pointingDeviceById(qint64 systemId);