summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Edmundson <davidedmundson@kde.org>2020-04-07 17:36:19 +0100
committerDavid Edmundson <davidedmundson@kde.org>2020-08-28 10:55:41 +0100
commitb1564c87e3fd1271575122c6b932c5e9324f07a7 (patch)
treeaf73aa1c6861ea8bfc1680f68ad784dfa09a764c /src
parent18ab3edaf2a4cdd1e9df6e166cf51a69a9785ecd (diff)
downloadqtwayland-b1564c87e3fd1271575122c6b932c5e9324f07a7.tar.gz
Client: Fix scroll direction with touchpads
Wayland axis events and QWheelEvents are opposite way rounds. This was handled for the case of discrete events, but not continuous events. This leads to touchpads moving the wrong way round compared to other clients. Change-Id: Iee4f5c620940a491949d4039cb3ac70649d83a2b Task-number: QTBUG-85767 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> (cherry picked from commit e20e1d506d627a53d9d7bf7794b93bf9e8b9bedb) Reviewed-by: David Edmundson <davidedmundson@kde.org>
Diffstat (limited to 'src')
-rw-r--r--src/client/qwaylandinputdevice.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp
index e0f0c6c8..ed4a0eb4 100644
--- a/src/client/qwaylandinputdevice.cpp
+++ b/src/client/qwaylandinputdevice.cpp
@@ -1025,6 +1025,12 @@ QPoint QWaylandInputDevice::Pointer::FrameData::pixelDeltaAndError(QPointF *accu
*accumulatedError += delta - pixelDelta;
Q_ASSERT(qAbs(accumulatedError->x()) < 1.0);
Q_ASSERT(qAbs(accumulatedError->y()) < 1.0);
+
+ // for continuous scroll events things should be
+ // in the same direction
+ // i.e converted so downwards surface co-ordinates (positive axis_value)
+ // goes to downwards in wheel event (negative value)
+ pixelDelta *= -1;
return pixelDelta;
}