summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorOliver Wolff <Oliver.Wolff@qt.io>2018-07-10 15:05:49 +0200
committerOliver Wolff <oliver.wolff@qt.io>2018-07-11 05:57:46 +0000
commit1faf5a36106ed55e7c15ad25d225ccf790b759d5 (patch)
treeacde75fa611b9797185d8315b7913974472370c5 /src/plugins/platforms
parenta0e2705f1fc1d8a38d013d1f7daa253b97d21e30 (diff)
winrt: Avoid superfluous touch events for multitouch
A touch press event's state has to be set to "stationary" after the touch event (including its list of touch points) has been passed to the QWindowSystemInterface. Following touch events (that are caused by another id) will not change the press event's state which can otherwise cause more than one press event for a given id in a multitouch setup. Task-number: QTBUG-58793 Change-Id: I44628912251beacfbda7dd37059577cb1d085bd5 Reviewed-by: Andre de la Rocha <andre.rocha@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/winrt/qwinrtscreen.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp
index 531e843829..928fff32d6 100644
--- a/src/plugins/platforms/winrt/qwinrtscreen.cpp
+++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp
@@ -1265,7 +1265,8 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *, IPointerEventArgs *args)
it.value().id = id;
}
- if (isPressed && it.value().pressure == 0.)
+ const bool wasPressEvent = isPressed && it.value().pressure == 0.;
+ if (wasPressEvent)
it.value().state = Qt::TouchPointPressed;
else if (!isPressed && it.value().pressure > 0.)
it.value().state = Qt::TouchPointReleased;
@@ -1279,6 +1280,8 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *, IPointerEventArgs *args)
it.value().pressure = pressure;
QWindowSystemInterface::handleTouchEvent(d->currentTargetWindow, d->touchDevice, d->touchPoints.values(), mods);
+ if (wasPressEvent)
+ it.value().state = Qt::TouchPointStationary;
// Fall-through for pen to generate tablet event
if (pointerDeviceType != PointerDeviceType_Pen)