From 60cd1c67759642018ef93cc45a90714729100d9d Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Thu, 28 Apr 2016 11:30:30 +0200 Subject: xcb: don't compress tablet motion events 7edd10e6c added this compression feature, but it's not a good idea for drawing-tablet applications, because smooth drawing depends on receiving every movement of the stylus. Also show the device ID in qt.qpa.input.devices category logging. [ChangeLog][X11] The new X event compression feature that was added in 5.6.0 no longer applies to motion events from drawing tablets. Task-number: QTBUG-44964 Change-Id: Icd2ca8ca77d8f80c2f39160c74208db10e382501 Reviewed-by: Gatis Paeglis --- src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'src/plugins/platforms/xcb/qxcbconnection_xi2.cpp') diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp index 9911afb11e..025dde3dbb 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp @@ -113,7 +113,7 @@ void QXcbConnection::xi2SetupDevices() // Only non-master pointing devices are relevant here. if (devices[i].use != XISlavePointer) continue; - qCDebug(lcQpaXInputDevices) << "input device "<< devices[i].name; + qCDebug(lcQpaXInputDevices) << "input device " << devices[i].name << "ID" << devices[i].deviceid; #ifndef QT_NO_TABLETEVENT TabletData tabletData; #endif @@ -530,12 +530,9 @@ void QXcbConnection::xi2HandleEvent(xcb_ge_event_t *event) #ifndef QT_NO_TABLETEVENT if (!xiEnterEvent) { - for (int i = 0; i < m_tabletData.count(); ++i) { - if (m_tabletData.at(i).deviceId == sourceDeviceId) { - if (xi2HandleTabletEvent(xiEvent, &m_tabletData[i], eventListener)) - return; - } - } + QXcbConnection::TabletData *tablet = tabletDataForDevice(sourceDeviceId); + if (tablet && xi2HandleTabletEvent(xiEvent, tablet, eventListener)) + return; } #endif // QT_NO_TABLETEVENT @@ -1198,6 +1195,16 @@ void QXcbConnection::xi2ReportTabletEvent(TabletData &tabletData, void *event) xTilt, yTilt, tangentialPressure, rotation, 0, tabletData.serialId); } + +QXcbConnection::TabletData *QXcbConnection::tabletDataForDevice(int id) +{ + for (int i = 0; i < m_tabletData.count(); ++i) { + if (m_tabletData.at(i).deviceId == id) + return &m_tabletData[i]; + } + return Q_NULLPTR; +} + #endif // QT_NO_TABLETEVENT #endif // XCB_USE_XINPUT2 -- cgit v1.2.3