summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSeokha Ko <seokha.ko@qt.io>2022-01-24 15:48:58 +0900
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-01-25 15:07:15 +0000
commit54d886d420bc0bc0a5d1c8fa28336665d8c77812 (patch)
tree8eb1d52542b388ea2e963bd59f3f4feac6232b66 /src
parenta3399e167c4a6088a7c20290419b682e2d2ad0dd (diff)
downloadqtwayland-54d886d420bc0bc0a5d1c8fa28336665d8c77812.tar.gz
Fix wayland touch event to use time stamp from wayland compositor
Touch events may be ignored if we set time stamp in handleTouchEvent() when handling touch events queued in wayland socket in main thread. So use time stamp from wayland compositor. Task-number: QTBUG-100150 Change-Id: I14fd3791b4d29177c71662d1cf26c0eed0abb767 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Seokha Ko <seokha.ko@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 2419064c3532e2efd3bcf2f23c9c690b0a0fdd00) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/client/qwaylandinputdevice.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp
index 444b98ec..7d8726b4 100644
--- a/src/client/qwaylandinputdevice.cpp
+++ b/src/client/qwaylandinputdevice.cpp
@@ -1405,7 +1405,7 @@ void QWaylandInputDevice::Touch::touch_down(uint32_t serial,
void QWaylandInputDevice::Touch::touch_up(uint32_t serial, uint32_t time, int32_t id)
{
Q_UNUSED(serial);
- Q_UNUSED(time);
+ mParent->mTime = time;
mParent->handleTouchPoint(id, QEventPoint::Released);
if (allTouchPointsReleased()) {
@@ -1424,8 +1424,8 @@ void QWaylandInputDevice::Touch::touch_up(uint32_t serial, uint32_t time, int32_
void QWaylandInputDevice::Touch::touch_motion(uint32_t time, int32_t id, wl_fixed_t x, wl_fixed_t y)
{
- Q_UNUSED(time);
QPointF position(wl_fixed_to_double(x), wl_fixed_to_double(y));
+ mParent->mTime = time;
mParent->handleTouchPoint(id, QEventPoint::Updated, position);
}
@@ -1524,7 +1524,7 @@ void QWaylandInputDevice::Touch::touch_frame()
return;
}
- QWindowSystemInterface::handleTouchEvent(window, mParent->mTouchDevice, mPendingTouchPoints, mParent->modifiers());
+ QWindowSystemInterface::handleTouchEvent(window, mParent->mTime, mParent->mTouchDevice, mPendingTouchPoints, mParent->modifiers());
// Prepare state for next frame
const auto prevTouchPoints = mPendingTouchPoints;