Bug 526317 - WheelHandler: Alt+wheel scrolls vertically on Wayland because Qt now swaps the axes too
Summary: WheelHandler: Alt+wheel scrolls vertically on Wayland because Qt now swaps th...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kirigami
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 6.30.0
Platform: Other Linux
: NOR normal
Target Milestone: Not decided
Assignee: kdelibs bugs
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2026-09-27 13:17 UTC by David Rios
Modified: 2026-10-23 16:52 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.32
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Rios 2026-09-27 13:17:05 UTC
On Wayland, Alt+wheel over a Kirigami-handled scroll view scrolls vertically instead of horizontally. This affects any Qt Quick Controls ScrollView in the org.kde.desktop style, whose Kirigami.WheelHandler scrolls the flickable. Shift+wheel pages vertically, as intended.

The axes are swapped twice:

1. Since QTBUG-124807 (qtwayland commit a1452b95f7, "Make wheel operations compatible with xcb"; in Qt 6.8 and backported to 6.7.2, 6.5.6, 6.2.13 and 5.15.18), Qt's Wayland platform plugin swaps angleDelta and pixelDelta when Alt is held, as the xcb plugin always has.
2. WheelHandler::scrollFlickable (src/wheelhandler.cpp, around line 538 in 6.30.0) swaps them again when Alt is held. It only skips that on xcb:

// HACK: Only transpose deltas when not using xcb in order to not conflict with xcb's own delta transposing
if (modifiers & m_defaultHorizontalScrollModifiers && qGuiApp->platformName() != QLatin1String("xcb")) {

On Wayland the event arrives already sideways, and the handler turns it back to vertical.

Steps to reproduce:

1. In a Wayland session, run this with QT_QUICK_CONTROLS_STYLE=org.kde.desktop qml6 test.qml:

import QtQuick
import QtQuick.Controls

ApplicationWindow {
    width: 400; height: 300; visible: true
    ScrollView {
        anchors.fill: parent
        Flickable {
            contentWidth: 2000; contentHeight: 2000
            Grid {
                columns: 20
                Repeater { model: 400; Rectangle { width: 100; height: 100; color: index % 2 ? "steelblue" : "lightgray" } }
            }
        }
    }
}

2. Scroll with the wheel while holding Alt.

Observed: the content scrolls vertically.
Expected: it scrolls horizontally, as it does with the xcb platform and in Qt Widgets apps on Wayland.

Logging the QWheelEvents the window receives shows a plain notch arriving as angleDelta (0, -180), and with Alt held as (-180, 0) with AltModifier set, so Qt has already swapped it. I got the same result under a nested KWin (input sent through org_kde_kwin_fake_input) and under sway, so it doesn't depend on the compositor.

Suggested fix: also skip the swap on Wayland (platformName() starting with "wayland") when running on a Qt that has the QTBUG-124807 fix.

Versions: Kirigami 6.30.0, qqc2-desktop-style 6.30.0, Qt 6.11.2, KWin (nested, --virtual) and sway 1.x, Arch Linux.
Comment 1 Bug Janitor Service 2026-10-22 15:30:15 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kirigami/-/merge_requests/2200
Comment 2 Marco Martin 2026-10-23 08:25:29 UTC
Git commit 1b4de2f324047f5f377205ebe7454e000c30fc98 by Marco Martin.
Committed on 23/10/2026 at 07:32.
Pushed by mart into branch 'master'.

WheelHandler: don't transpose the delta on wayland as well

also on wayland the deltas will already be transposed by Qt on alt
pressed, so don't do it twice

M  +2    -1    src/wheelhandler.cpp

https://invent.kde.org/frameworks/kirigami/-/commit/1b4de2f324047f5f377205ebe7454e000c30fc98
Comment 3 Marco Martin 2026-10-23 08:25:37 UTC
Git commit 947b26d0bf95bb15fc70e7c132e4fbfdda8a9a90 by Marco Martin.
Committed on 23/10/2026 at 07:34.
Pushed by mart into branch 'master'.

WheelHandler: don't transpose the delta on wayland as well

also on wayland the deltas will already be transposed by Qt on alt
pressed, so don't do it twice

M  +1    -1    src/wheelhandler.cpp

https://invent.kde.org/frameworks/kirigami/-/commit/947b26d0bf95bb15fc70e7c132e4fbfdda8a9a90