Repository navigation
fix(linux): keep KWin output order stable - #6183
Open
ZorudaRinku wants to merge 1 commit into
Open
ZorudaRinku wants to merge 1 commit into
ZorudaRinku wants to merge 1 commit into
Conversation
The sort checked priority OR x OR y, so any one comparison could win and two monitors could both count as first. If the primary monitor wasn't at x=0, the list came back in a different order each time and Ctrl+Alt+Shift+F1/F2 swapped screens. Now it sorts by priority, then x, then y.
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
With KWin capture, the monitor list order changed every session if the primary monitor wasn't the leftmost one. The sort checked priority OR x OR y, so any comparison could win and two monitors could both be "first". On my setup (primary in the middle, a monitor at x=0 on the left) Ctrl+Alt+Shift+F1 and F2 kept swapping screens while F3 was always right.
The fix sorts by priority first, then x, then y. With 3 monitors on Plasma 6, F1/F2/F3 now always land on the same screen.
Screenshot
Issues Fixed or Closed
Roadmap Issues
Testing
No automated test. The sort lives inside the KWin screencast class and needs a live KWin session, and there are no kwingrab unit tests to extend. Tested by hand on CachyOS with Plasma 6, an RTX 3080 and an AMD iGPU, with 3 monitors (primary DP-2 at x=1920, HDMI-A-3 at x=0, DP-4 at x=4480). Before the fix the "[kwingrab] Found output" log order flipped between DP-2 and HDMI-A-3 across sessions and F1/F2 swapped screens. After it the order stays DP-2, HDMI-A-3, DP-4 and F1/F2/F3 always pick the same screen.
Type of Change
Checklist
AI Usage
See our AI usage policy.