diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2019-11-04 14:21:18 +0100 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2019-11-06 07:50:41 +0000 |
commit | 44fbe562b544119a9d23a72c3d577d2946c72162 (patch) | |
tree | 24c08264f16ea3ccc0714556d727c4cb674c4fe1 | |
parent | 8676fb35b3efed69d39d17070e78bc93055939ee (diff) | |
download | qtwayland-44fbe562b544119a9d23a72c3d577d2946c72162.tar.gz |
Fix touch being ignored when down and motion 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.motion
within the same frame.
Fixes: QTBUG-79744
Change-Id: I5dd9302576d81da38e003c8e7e74da6a98def603
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
(cherry picked from commit 57c28f461a066c03ef8ae3f823c040fa91876fb8)
-rw-r--r-- | src/client/qwaylandinputdevice.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp index e781d476..107442da 100644 --- a/src/client/qwaylandinputdevice.cpp +++ b/src/client/qwaylandinputdevice.cpp @@ -942,7 +942,10 @@ void QWaylandInputDevice::handleTouchPoint(int id, Qt::TouchPointState state, co tp.area.moveCenter(globalPosition); } - tp.state = state; + // If the touch point was pressed earlier this frame, we don't want to overwrite its state. + if (tp.state != Qt::TouchPointPressed) + tp.state = state; + tp.pressure = tp.state == Qt::TouchPointReleased ? 0 : 1; } |