Bug 483601 - Reverse scroll direction when navigating virtual desktops with Super+Alt+mousewheel shortcut
Summary: Reverse scroll direction when navigating virtual desktops with Super+Alt+mous...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: libinput (show other bugs)
Version: 6.2.5
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: qt6
: 498523 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-03-14 19:44 UTC by arpan
Modified: 2025-01-16 16:22 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description arpan 2024-03-14 19:44:32 UTC
SUMMARY
***
If you use a mouse(or touchpad) and try to switch the virtual desktop using Super + Alt + mouse scroll, then the virtual desktop switching works but in opposite direction of mouse scroll.

If the user has not selected "Invert scroll direction", then scrolling downwards along with Super + Alt keys combo, the user should be taken to next virtual desktop. But, currently this action takes user to the previous desktop, and if the user is on the first desktop, the action has no effect at all.

The switching works as if "Invert scroll direction" is selected, irrespective of actual selection of the setting.
***


STEPS TO REPRODUCE
1. In System Settings, configure 2 virtual desktops, and  display them in 2 rows in pager(to emphasize the problem for mouse users as there is no horizontal scroll option). Issue remains the same if you display them in however many rows you want.
2. Make sure that you have deselected "Invert scroll direction" under System Settings -> Mouse and Touchpad -> Mouse.
3. Now, go to the first virtual desktop if you are not there already.
4. Press Super + Alt keys combination, and simultaneously scroll mouse wheel downwards. You will NOT be taken to 2nd/next virtual desktop as expected.
5. Now, repeat above step but scroll mouse wheel upwards. You will be taken to the 2nd virtual desktop.

OBSERVED RESULT
The virtual desktop switching does not respect the mouse scroll direction setting. This creates a very confusing and rough experience for user as the scroll direction works as expected in all other apps for the user, but not for desktop switching.

EXPECTED RESULT
The virtual desktop switching must respect the mouse scroll direction setting. Scrolling down should take user to the next desktop and scrolling up should take user to the previous desktop.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.7.9-arch1-1 (64-bit)
KDE Plasma Version: 6.0.2
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2024-04-09 22:48:52 UTC
What exact thing are you scrolling over to switch virtual desktops?
Comment 2 arpan 2024-04-11 04:15:19 UTC
The issue is reproducible by scrolling on desktop itself and desktop pager in panel, both.
Comment 3 Bug Janitor Service 2024-04-26 03:46:19 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 4 TraceyC 2024-08-19 22:08:03 UTC
I'm not able to reproduce this on 6.1.4, but I am able to reproduce on git-master (scrolling down moves to the virtual desktop above the last one, and vice versa)

FWIW, you can just use the scroll wheel over the desktop or pager. You don't need to also hold down Super + Alt
https://docs.kde.org/stable5/en/kwin/kcontrol/desktop/index.html
Comment 5 fanzhuyifan 2025-01-11 15:34:11 UTC
This report is about the Meta+Alt+Scroll shortcuts configured by kwin, while BUG 493467 is about scrolling on the pager.
Comment 6 fanzhuyifan 2025-01-11 15:34:27 UTC
*** Bug 498523 has been marked as a duplicate of this bug. ***
Comment 7 fanzhuyifan 2025-01-11 15:39:23 UTC
In particular, kwin configures Meta+Alt+PointerAxisDown to be "Switch to Next Desktop",
(https://invent.kde.org/plasma/kwin/-/blob/b36151e81a456d25b118abadb791b4a12bc624be/src/virtualdesktops.cpp#L792)
scrolling to move the content down generates libinput pointer axis events with positive y value (with or without natural scroll), however that seems to be converted to PointerAxisUp events by kwin (https://invent.kde.org/plasma/kwin/-/blob/b36151e81a456d25b118abadb791b4a12bc624be/src/input.cpp#L999)
Comment 8 Bug Janitor Service 2025-01-11 22:30:31 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/6991
Comment 9 Vlad Zahorodnii 2025-01-16 16:22:58 UTC
Git commit 369ebc17b174a42b6bda6d22ec31ec8cdb36aefa by Vlad Zahorodnii, on behalf of Yifan Zhu.
Committed on 16/01/2025 at 16:08.
Pushed by vladz into branch 'master'.

input: fix axis shortcut direction

Currently kwin directly construct pointerAxis events from libinput,
instead of relying on QWheelEvent. So positive delta corresponds to
right/down, instead of left/up.

M  +6    -6    autotests/integration/lockscreen.cpp
M  +6    -6    autotests/integration/no_global_shortcuts_test.cpp
M  +4    -4    src/input.cpp
M  +2    -2    src/plugins/zoom/zoom.cpp

https://invent.kde.org/plasma/kwin/-/commit/369ebc17b174a42b6bda6d22ec31ec8cdb36aefa