summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHyunkook Khang <hyunkook.khang@qt.io>2020-04-29 11:13:55 +0900
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-04-12 09:55:32 +0000
commit5d81abe0739235b8597b9c50b40b89419ac29918 (patch)
tree87cd948a225940013318310ac93f9c62ee5ba92d
parent9f35ae7d161623be3cb61a2396d86f3000c5d4b4 (diff)
downloadqtwayland-5d81abe0739235b8597b9c50b40b89419ac29918.tar.gz
Fix touch being ignored when down and up are in the same frame
The Wayland protocol gives no guarantees about which events are part of a frame, so handle the case where we receive wl_touch.down and wl_touch.up within the same frame. Fixes: QTBUG-89680 Change-Id: Ie0b9d2fb950fb0d9a6af8dd8ad2fa55a5efa71e6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit da31aa6544f38c063de93326f958e8cbb02004af) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/client/qwaylandinputdevice.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp
index 5be49993..5c236989 100644
--- a/src/client/qwaylandinputdevice.cpp
+++ b/src/client/qwaylandinputdevice.cpp
@@ -1423,6 +1423,14 @@ void QWaylandInputDevice::handleTouchPoint(int id, Qt::TouchPointState state, co
it = mTouch->mPendingTouchPoints.insert(end, QWindowSystemInterface::TouchPoint());
it->id = id;
}
+ // If the touch points were up and down in same frame, send out frame right away
+ else if ((it->state == QEventPoint::Pressed && state == QEventPoint::Released)
+ || (it->state == QEventPoint::Released && state == QEventPoint::Pressed)) {
+ mTouch->touch_frame();
+ it = mTouch->mPendingTouchPoints.insert(mTouch->mPendingTouchPoints.end(), QWindowSystemInterface::TouchPoint());
+ it->id = id;
+ }
+
QWindowSystemInterface::TouchPoint &tp = *it;
// Only moved and pressed needs to update/set position