https://bugs.kde.org/show_bug.cgi?id=522288

Carlos <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #8 from Carlos <[email protected]> ---
I can reproduce this on Plasma 6.7.5 (Bazzite / Fedora 44, Wayland), on a
desktop with two DisplayPort monitors and no built-in panel: a 1440p set as
primary on the right, and a 1080p on the left.

Cause: in common/osdaction.cpp, OsdAction::applyAction() looks for an output of
type Panel. When there isn't one, it falls back to outputs.begin(), so
whichever output happens to be listed first is treated as "built-in". After a
reboot that was my non-primary 1080p, so every option did the opposite of what
I expected.

Two more effects I noticed:
- The list order isn't stable. After disabling and re-enabling an output, the
other monitor can become first, so the switcher alternates between right and
wrong without any settings change.
- A wrong switch also changes the primary. "Only use built-in screen" disables
my real primary, so KWin makes the other output primary. The extend actions
don't set priorities, so after extending again, Display Settings keeps showing
the wrong monitor as primary.

Possible fix, only when no output is a real panel, so laptops are unaffected:
1. Use the primary output as the "built-in" stand-in instead of the first in
the list.
2. Remember which output that was (e.g. by hashMd5(), per set of monitors)
while all outputs are enabled, and use the remembered one when an output is
off. Otherwise "Only use external screen" makes the other output primary and
the roles swap on the next action.
3. Make the stand-in primary again whenever an action re-enables it.

I tried this locally on 6.7.5 with a patch written with the help of Claude. It
added unit tests to tests/osdactions.cpp (all pass, including the existing
laptop and Steam Deck ones), and I live-tested the patched kscreen_osd_service
against the stock one on my setup. With the change, the popup consistently
followed my primary, and switching to the other screen and back no longer
swapped the roles. I'm happy to share the patch for reference, but since it's
AI-written and I'm not familiar with the codebase, I won't be opening a merge
request myself. It would need review by someone who knows kscreen.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to