From f6fb0407de740b8b70c047a5cd9d3a556333fb04 Mon Sep 17 00:00:00 2001 From: Inho Lee Date: Tue, 30 Apr 2024 12:05:35 +0200 Subject: [PATCH] Make wheel operations compatible with xcb On xcb, Alt modifier makes wheel operations horizontal. Fixes: QTBUG-124807 Pick-to: 6.7 6.5 Change-Id: I98cfe14b4df91169a5ff4e777ebe954087747e17 Reviewed-by: Vlad Zahorodnii Reviewed-by: Thiago Macieira --- src/plugins/platforms/wayland/qwaylandinputdevice.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp index 1df7ac4833b..ce04971ba6f 100644 --- a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp +++ b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp @@ -892,8 +892,10 @@ public: WheelEvent(QWaylandWindow *surface, Qt::ScrollPhase phase, ulong timestamp, const QPointF &local, const QPointF &global, const QPoint &pixelDelta, const QPoint &angleDelta, Qt::MouseEventSource source, Qt::KeyboardModifiers modifiers, bool inverted) - : QWaylandPointerEvent(QEvent::Wheel, phase, surface, timestamp, - local, global, pixelDelta, angleDelta, source, modifiers, inverted) + : QWaylandPointerEvent(QEvent::Wheel, phase, surface, timestamp, local, global, + modifiers & Qt::AltModifier ? pixelDelta.transposed() : pixelDelta, + modifiers & Qt::AltModifier ? angleDelta.transposed() : angleDelta, + source, modifiers, inverted) { } };