Bug 451286 - Swapping monitors does not change order for "Window to Next Screen" shortcut
Summary: Swapping monitors does not change order for "Window to Next Screen" shortcut
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: multi-screen (show other bugs)
Version: 5.23.5
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Natalie Clarius
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-08 18:02 UTC by Florine W. Dekker
Modified: 2022-12-08 20:09 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florine W. Dekker 2022-03-08 18:02:26 UTC
SUMMARY
If the positions of monitors are swapped around in System Settings, the "Window to Previous Screen" and "Window to Next Screen" shortcuts adhere to the old positions of monitors instead of the new positions. However, if this is done manually using xrandr, the shortcuts work as intended. Therefore, I think that System Settings is misbehaving.

STEPS TO REPRODUCE
1. Under "Shortcuts > Shortcuts > KWin", add a shortcut for "Window to Next Screen".
2. Under "Display and Monitor > Display Configuration", place three monitors next to each other. Let's call them A, B, C, from left to right. Apply settings.
3. Open any window on monitor B, and use the "Window to Next Screen" shortcut. Verify that the window moves to monitor C, as expected. (If not, it may help to restart the computer, so that the order A, B, C is loaded from the start.)
4. Under "Display and Monitor > Display Configuration", swap the positions of monitors A and C, so that the order is C, B, A.
5. Open any window on monitor B, and use the "Window to Next Screen" shortcut.

OBSERVED RESULT
The window on monitor B moves to monitor C. (To the left!)

EXPECTED RESULT
The window on monitor B moves to monitor A. (To the right!)

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
KDE Plasma Version: 5.23.5
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
If I change the order of monitors using xrandr, this bug does not occur. Concretely, the following steps give the expected result noted above:

1. Under "Shortcuts > Shortcuts > KWin", add a shortcut for "Window to Next Screen".
2. Run
   ```bash
   xrandr --output DP-0 --mode 2560x1440
   xrandr --output DP-5 --mode 1600x900 --left-of DP-0
   xrandr --output DVI-D-0 --mode 1280x1024 --right-of DP-0
   ```
3. Open any window on monitor B, and use the "Window to Next Screen" shortcut. Verify that the window moves to monitor C, as expected. (No computer restart should be necessary.)
4. Run
   ```bash
   xrandr --output DP-0 --mode 2560x1440
   xrandr --output DP-5 --mode 1600x900 --right-of DP-0
   xrandr --output DVI-D-0 --mode 1280x1024 --left-of DP-0
   ```
   (Note that "left" and "right" have been swapped relative to step 2.)
5. Open any window on monitor B, and use the "Window to Next Screen" shortcut.
Comment 1 Bug Janitor Service 2022-11-14 20:33:38 UTC
Thank you for the bug report!

However Plasma 5.23.5 is no longer supported by KDE; supported versions are 5.24, and 5.26 or newer.
Your distribution is responsible for providing support for older versions of KDE software.

Please do one of the following:
- Upgrade to a supported version and see if the issue is still relevant
- Report the issue to your distribution
Comment 2 Nate Graham 2022-11-14 21:39:42 UTC
bad bot
Comment 3 Bug Janitor Service 2022-11-30 14:33:37 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/3255
Comment 4 Vlad Zahorodnii 2022-12-08 19:22:16 UTC
Git commit 084b88522c7ce751a07472c5f72217b23c02a056 by Vlad Zahorodnii, on behalf of Natalie Clarius.
Committed on 08/12/2022 at 18:59.
Pushed by vladz into branch 'master'.

workspace: get output in direction relative from reference
Related: bug 453038

M  +0    -14   src/useractions.cpp
M  +54   -0    src/workspace.cpp
M  +10   -2    src/workspace.h

https://invent.kde.org/plasma/kwin/commit/084b88522c7ce751a07472c5f72217b23c02a056