summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2019-09-16 13:55:57 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2019-09-25 16:13:46 +0200
commitd570f196527c561a474dbb8443fdf8b486ed7215 (patch)
tree59c0517215bdad5f5e4c7bf10bbc5bcb01bb46f9
parente8b3593ecb8b48ec53309b923ac8a642992768cd (diff)
Mark stationary touch points as updated if pressure or velocity changes
This is to inform Qt Quick when a stationary touchpoint is delivered that it is because of a changed property. Qt Quick still needs to avoid delivering item-customized events (with only the touch points that occur inside the item) that contain only stationary touch points without changed properties. To be able to check this private flag, QQuickPointerTouchEvent needs to be a friend. Task-number: QTBUG-77142 Change-Id: I6ee0dffbbeca9e513c77227b757252e2eec6a4ef Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 217dd1b3b03cd40b4bb926631464c684f7f84a69)
-rw-r--r--src/gui/kernel/qevent.h1
-rw-r--r--src/gui/kernel/qevent_p.h4
-rw-r--r--src/gui/kernel/qguiapplication.cpp2
3 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h
index 2b1c6a6e31..e4d3400355 100644
--- a/src/gui/kernel/qevent.h
+++ b/src/gui/kernel/qevent.h
@@ -935,6 +935,7 @@ public:
friend class QGuiApplicationPrivate;
friend class QApplication;
friend class QApplicationPrivate;
+ friend class QQuickPointerTouchEvent;
};
#if QT_DEPRECATED_SINCE(5, 0)
diff --git a/src/gui/kernel/qevent_p.h b/src/gui/kernel/qevent_p.h
index 7df4a1e25b..b5d5cc5bff 100644
--- a/src/gui/kernel/qevent_p.h
+++ b/src/gui/kernel/qevent_p.h
@@ -67,7 +67,8 @@ public:
state(Qt::TouchPointReleased),
pressure(-1),
rotation(0),
- ellipseDiameters(0, 0)
+ ellipseDiameters(0, 0),
+ stationaryWithModifiedProperty(false)
{ }
inline QTouchEventTouchPointPrivate *detach()
@@ -91,6 +92,7 @@ public:
QSizeF ellipseDiameters;
QVector2D velocity;
QTouchEvent::TouchPoint::InfoFlags flags;
+ bool stationaryWithModifiedProperty : 1;
QVector<QPointF> rawScreenPositions;
};
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 51cde72fa1..142e0c095d 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -2775,10 +2775,12 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To
if (touchPoint.state() == Qt::TouchPointStationary) {
if (touchInfo.touchPoint.velocity() != touchPoint.velocity()) {
touchInfo.touchPoint.setVelocity(touchPoint.velocity());
+ touchPoint.d->stationaryWithModifiedProperty = true;
stationaryTouchPointChangedProperty = true;
}
if (!qFuzzyCompare(touchInfo.touchPoint.pressure(), touchPoint.pressure())) {
touchInfo.touchPoint.setPressure(touchPoint.pressure());
+ touchPoint.d->stationaryWithModifiedProperty = true;
stationaryTouchPointChangedProperty = true;
}
} else {