diff options
author | Hyunkook Khang <hyunkook.khang@qt.io> | 2020-04-29 11:13:55 +0900 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-04-12 08:51:20 +0000 |
commit | da31aa6544f38c063de93326f958e8cbb02004af (patch) | |
tree | a033f31546aae339f47a49fa0548031aec5e9c60 /src | |
parent | 70cce0234c166a907c8ae13fc007f728d1ed5742 (diff) |
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
Pick-to: 5.15 6.1 6.0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/client/qwaylandinputdevice.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp index fb9c63d8f..420194733 100644 --- a/src/client/qwaylandinputdevice.cpp +++ b/src/client/qwaylandinputdevice.cpp @@ -1419,6 +1419,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 |