From 24cf218b3985941887a7f0dcfc249e3367768700 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Wed, 23 Dec 2020 16:00:26 +0100 Subject: [PATCH] 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 --- src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 7 +++---- 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(QObjectPrivate::get(q));