diff options
author | Paul Olav Tvete <paul.tvete@qt.io> | 2020-12-23 16:00:26 +0100 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@qt.io> | 2020-12-25 09:07:18 +0100 |
commit | 24cf218b3985941887a7f0dcfc249e3367768700 (patch) | |
tree | fed392d90e111fd74d050a2de6708661c69ddaa6 /src/plugins/platforms/xcb | |
parent | 9a237257c441e455a4aaf1cf1a51bc21eed46ff9 (diff) |
Handle XCB_INPUT_DEVICE_TYPE_MASTER_POINTER properly
Make sure we use the new QXcbScrollingDevice class for the "core
pointer" as well.
Change-Id: I97575e8125cbb2aa280662aa675e61021c21ea59
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 7 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbscrollingdevice_p.h | 6 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp index 04d2c57e9e..07f66af9e3 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp @@ -472,10 +472,9 @@ void QXcbConnection::xi2SetupDevices() } break; case XCB_INPUT_DEVICE_TYPE_MASTER_POINTER: { m_xiMasterPointerIds.append(deviceInfo->deviceid); - auto dev = new QPointingDevice(QString::fromUtf8(xcb_input_xi_device_info_name(deviceInfo)), deviceInfo->deviceid, - QInputDevice::DeviceType::Mouse, QPointingDevice::PointerType::Generic, - QInputDevice::Capability::Position | QInputDevice::Capability::Scroll | QInputDevice::Capability::Hover, - 1, 32, QString::number(deviceInfo->attachment << 16 | deviceInfo->deviceid, 16), QPointingDeviceUniqueId(), this); + auto dev = new QXcbScrollingDevice(QString::fromUtf8(xcb_input_xi_device_info_name(deviceInfo)), deviceInfo->deviceid, + QInputDevice::Capability::Position | QInputDevice::Capability::Scroll | QInputDevice::Capability::Hover, + 32, QString::number(deviceInfo->attachment << 16 | deviceInfo->deviceid, 16), this); QWindowSystemInterface::registerInputDevice(dev); continue; } break; diff --git a/src/plugins/platforms/xcb/qxcbscrollingdevice_p.h b/src/plugins/platforms/xcb/qxcbscrollingdevice_p.h index 6222e92ff2..773a8135b4 100644 --- a/src/plugins/platforms/xcb/qxcbscrollingdevice_p.h +++ b/src/plugins/platforms/xcb/qxcbscrollingdevice_p.h @@ -69,6 +69,12 @@ public: QXcbScrollingDevice(QXcbScrollingDevicePrivate &d, QObject *parent) : QPointingDevice(d, parent) {} + QXcbScrollingDevice(const QString &name, qint64 deviceId, Capabilities caps, int buttonCount, + const QString &seatName = QString(), QObject *parent = nullptr) + : QPointingDevice(*new QXcbScrollingDevicePrivate(name, deviceId, caps, buttonCount, seatName), parent) + { + } + inline static QXcbScrollingDevicePrivate *get(QXcbScrollingDevice *q) { return static_cast<QXcbScrollingDevicePrivate *>(QObjectPrivate::get(q)); |