From 1b0c45f683cef20aacc8f40273aa89200e9924e4 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Fri, 23 Aug 2019 08:47:30 +0200 Subject: Deliver stationary touchpoints that have changed pressure As a rule, we don't deliver touch events containing only stationary touchpoints. To fix QTBUG-52510 we added an exception in 1bd0ab7050304d9e8989cde77e486947c56b9696 : if the velocity changed, deliver it anyway. Now we need to do the same if the pressure changed. Also, on the customer's hardware, pressure is indicated via ABS_MT_PRESSURE. Change-Id: If7f7088df055d686cdd86967b999e38024f8170f Fixes: QTBUG-77142 Reviewed-by: Laszlo Agocs --- src/gui/kernel/qguiapplication.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/gui/kernel') diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 359d182dd9..51cde72fa1 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -2695,7 +2695,7 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To QWindow *window = e->window.data(); typedef QPair > StatesAndTouchPoints; QHash windowsNeedingEvents; - bool stationaryTouchPointChangedVelocity = false; + bool stationaryTouchPointChangedProperty = false; for (int i = 0; i < e->points.count(); ++i) { QTouchEvent::TouchPoint touchPoint = e->points.at(i); @@ -2775,7 +2775,11 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To if (touchPoint.state() == Qt::TouchPointStationary) { if (touchInfo.touchPoint.velocity() != touchPoint.velocity()) { touchInfo.touchPoint.setVelocity(touchPoint.velocity()); - stationaryTouchPointChangedVelocity = true; + stationaryTouchPointChangedProperty = true; + } + if (!qFuzzyCompare(touchInfo.touchPoint.pressure(), touchPoint.pressure())) { + touchInfo.touchPoint.setPressure(touchPoint.pressure()); + stationaryTouchPointChangedProperty = true; } } else { touchInfo.touchPoint = touchPoint; @@ -2816,7 +2820,7 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To break; case Qt::TouchPointStationary: // don't send the event if nothing changed - if (!stationaryTouchPointChangedVelocity) + if (!stationaryTouchPointChangedProperty) continue; Q_FALLTHROUGH(); default: -- cgit v1.2.3