summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbconnection.h
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2020-11-26 16:38:55 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2020-12-15 19:03:24 +0100
commitac210c73e43621f942d3cb947eef036fc5e7646e (patch)
tree4dd3a8b435525a520d6a0176ad6078fbbdbfdd2f /src/plugins/platforms/xcb/qxcbconnection.h
parent50e1976437f645e9d6571d4498e9d44388e59c19 (diff)
xcb: report wheel events from the correct device instance
Until now, all wheel events came from one "core pointer". It's useful in Qt Quick to tell the devices apart, because some support smooth scrolling and some don't. Also remove the QHash storing legacy ScrollingDevice structs, and use a subclass of QPointingDevicePrivate instead. Task-number: QTBUG-46412 Task-number: QTBUG-72167 Task-number: QTBUG-69433 Change-Id: Ie6a3d8dd494f981e8706b9a66a1021dfb51baec4 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection.h')
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.h23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h
index 67caf7d827..b62d461170 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.h
+++ b/src/plugins/platforms/xcb/qxcbconnection.h
@@ -78,6 +78,7 @@ class QXcbScreen;
class QXcbWindow;
class QXcbDrag;
class QXcbKeyboard;
+class QXcbScrollingDevicePrivate;
class QXcbClipboard;
class QXcbWMSupport;
class QXcbNativeInterface;
@@ -264,7 +265,7 @@ private:
void xi2SetupSlavePointerDevice(void *info, bool removeExisting = true, QPointingDevice *master = nullptr);
void xi2SetupDevices();
- // TODO get rid of this: store a smaller struct in QPointingDevicePrivate::extra
+ // TODO get rid of this: store minimal necessary info in a subclass of QPointingDevicePrivate
struct TouchDeviceData {
QPointingDevice *qtTouchDevice = nullptr;
QHash<int, QWindowSystemInterface::TouchPoint> touchPoints;
@@ -290,7 +291,7 @@ private:
void xi2HandleDeviceChangedEvent(void *event);
void xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindow);
#if QT_CONFIG(tabletevent)
- // TODO get rid of this: store a smaller struct in QPointingDevicePrivate::extra
+ // TODO get rid of this: store minimal necessary info in a subclass of QXcbScrollingDevice (some tablets can scroll)
struct TabletData {
int deviceId = 0;
QString name;
@@ -314,21 +315,9 @@ private:
QList<TabletData> m_tabletData;
TabletData *tabletDataForDevice(int id);
#endif // QT_CONFIG(tabletevent)
- // TODO get rid of this: store a smaller struct in QPointingDevicePrivate::extra
- struct ScrollingDevice {
- int deviceId = 0;
- int verticalIndex = 0;
- int horizontalIndex = 0;
- double verticalIncrement = 0;
- double horizontalIncrement = 0;
- Qt::Orientations orientations;
- Qt::Orientations legacyOrientations;
- QPointF lastScrollPosition;
- };
- QHash<int, ScrollingDevice> m_scrollingDevices;
- void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice);
- void xi2UpdateScrollingDevice(ScrollingDevice &scrollingDevice);
- ScrollingDevice *scrollingDeviceForId(int id);
+ void xi2HandleScrollEvent(void *event, const QPointingDevice *scrollingDevice);
+ void xi2UpdateScrollingDevice(QXcbScrollingDevicePrivate *scrollingDevice);
+ QXcbScrollingDevicePrivate *scrollingDeviceForId(int id);
static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value);