| Summary: | kwin selects wrong monitor as active | ||
|---|---|---|---|
| Product: | [Plasma] kwin | Reporter: | nodscher <nodscher> |
| Component: | multi-screen | Assignee: | KWin default assignee <kwin-bugs-null> |
| Status: | REPORTED --- | ||
| Severity: | normal | CC: | nate, nodscher, xaver.hugl |
| Priority: | NOR | Keywords: | multiscreen, wayland-only |
| Version First Reported In: | 6.3.3 | ||
| Target Milestone: | --- | ||
| Platform: | Arch Linux | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
nodscher
2025-03-15 10:56:11 UTC
On x11 plasma and kscreenlocker behave as expected and select the monitor where the mouse is. On wayland it is like described above SDDM selects the secondary monitor on wayland and x Hi, I looked into this myself and this is what happens here as far as I can tell: kwin adds outputs in the order the gpu driver gives it --> plasma/sddm/kscreenlocker want to be on all screens so they loop over the screens in that same order --> they create windows (or whatever) in that order --> whatever window was created last, as well as its screen, has the focus that means that the focus in those cases is determined by the order the gpu gives to kwin, which happens to make my primary monitor "primary" on nvidia and my secondary on amd/nouveau (theoretically sddm has code to change focus itself, but that doesn't seem to do anything) changing the append to prepend in DrmBackend::addOutput fixes the issue in my specific case I tried to make a "proper" fix myself, by making the output list the inverse of the OutputOrder, but I didn't manage to get that Information in drm_backend.cpp (probably just because I don't know cpp though) Also kscreenlocker checked where the cursor was for a while, both fixing this and making it still work properly if the cursor was on a different screen, but that broke again in 6.5 (or 6.4.5). I would try to bisect it, but I'm not sure how to bisect plasma with it's many subprojects. Simply downgrading plasma-desktop plasma-workspace and kscreenlocker didn't make a difference. |