Bug 516611 - Screen priority/ordering thrown off by power profiles
Summary: Screen priority/ordering thrown off by power profiles
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: output configuration (other bugs)
Version First Reported In: unspecified
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Christian Lampe
URL:
Keywords: regression
: 516954 (view as bug list)
Depends on:
Blocks:
 
Reported: 2026-02-23 19:00 UTC by Christian Lampe
Modified: 2026-03-03 12:01 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.6.2
Sentry Crash Report:


Attachments
Screen recording of the issue in action (2.24 MB, video/mp4)
2026-02-23 19:00 UTC, Christian Lampe
Details
A recording of the issue occurring (28 bytes, text/plain)
2026-02-23 19:22 UTC, Christian Lampe
Details
`kscreen-doctor -o` output with the screens in correct order (3.35 KB, text/plain)
2026-02-23 19:37 UTC, Christian Lampe
Details
`kscreendoctor -o` output with the screens manually put to incorrect order (3.35 KB, text/plain)
2026-02-23 19:40 UTC, Christian Lampe
Details
`kscreendoctor -o` output with the screens in incorrect order (3.35 KB, text/plain)
2026-02-23 19:44 UTC, Christian Lampe
Details
`kscreen-doctor -o` output with the screens in fixed order (3.35 KB, text/plain)
2026-02-23 19:45 UTC, Christian Lampe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Lampe 2026-02-23 19:00:18 UTC
Created attachment 190021 [details]
Screen recording of the issue in action

SUMMARY


STEPS TO REPRODUCE
1. Set up charge state profiles on a laptop with 2 external displays   
2. Set different wallpapers for the different screens   
3. Plug in or unplug the charger   

OBSERVED RESULT
The external displays get swapped in their ordering, but not placement; the background images swap places   

EXPECTED RESULT
Nothing should change except for the power profile   

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 43
KDE Plasma Version: 6.6.0
KDE Frameworks Version: 6.23.0
Qt Version: 6.10.1
Kernel Version: 6.18.12-200.fc43.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 12 × 12th Gen Intel® Core™ i5-1235U
Memory: 32 Gibyte of RAM (31.0 Gibyte usable)
Graphics Processor: Intel® Iris® Xe Graphics
Manufacturer: Dell Inc.
Product Name: Latitude 5530

ADDITIONAL INFORMATION
Changing charge state profile settings also causes the reordering
Comment 1 Christian Lampe 2026-02-23 19:22:57 UTC
Created attachment 190022 [details]
A recording of the issue occurring

The screen recording failed somewhat and shows only a static image, so here it is recorded again, with my phone…
Comment 2 Zamundaaa 2026-02-23 19:25:35 UTC
Please attach the output of
> kscreen-doctor -o
for when they're in the correct order, and for when they're wrong.
Comment 3 Christian Lampe 2026-02-23 19:29:27 UTC
I just did a reboot with screen 3 unplugged, and now the issue does not occur. I noticed that the issue only started after the screens accidentally got reordered when the laptop woke up with the lid closed, so I'll do that and see if the issue reappears and otherwise do a reboot with all screens connected. But the screen order has been a little flakey for me since a few months now, this was just the most annoying manifestation of that as the battery going low enough for triggering "low charge" mode swapped the screens around unexpectedly…
Comment 4 Christian Lampe 2026-02-23 19:37:57 UTC
Created attachment 190024 [details]
`kscreen-doctor -o` output with the screens in correct order

Here is the output while the screens are in the correct order. I can also manually put the screens in the wrong order again, but it seems like the automatic reordering only occurs if the system has been hibernated and put to sleep and woken from each several times and the uptime nears one day, not just mere minutes. It's one of those annoying bugs that seem quite random in their root cause…
Comment 5 Christian Lampe 2026-02-23 19:40:11 UTC
Created attachment 190025 [details]
`kscreendoctor -o` output with the screens manually put to incorrect order

Here it is with manual reordering. Hope it at least helps a little…
Comment 6 Christian Lampe 2026-02-23 19:44:36 UTC
Created attachment 190026 [details]
`kscreendoctor -o` output with the screens in incorrect order

I managed to cause the issue again: I manually put the screens into the incorrect order, then unplugged screen 3 (which was now defined as screen 2). Then I clicked around in the screen settings panel a bit, not changing any settings. Just flicked back and forth between the two still-connected screens and observed the little "Main screen" indicator turning on and off below. Then I plugged the screen back in and changed the order back to how I wanted it, with the newly-replugged monitor as screen 3. Unplugging the charger switched screens 2 and 3 again…
Comment 7 Christian Lampe 2026-02-23 19:45:35 UTC
Created attachment 190027 [details]
`kscreen-doctor -o` output with the screens in fixed order
Comment 8 Zamundaaa 2026-02-23 20:07:02 UTC
Hmm, if you the same thing, but close and re-open system settings in between, does it also swap the order?
Mostly wondering if it's an issue with the display settings, or actually in KWin.
Comment 9 Christian Lampe 2026-02-23 20:11:08 UTC
(In reply to Zamundaaa from comment #8)
> Hmm, if you the same thing, but close and re-open system settings in
> between, does it also swap the order?
> Mostly wondering if it's an issue with the display settings, or actually in
> KWin.

I mean, the issue also occurs with the settings window closed, but I'll have to completely reboot and then probably do a "hibernate, sleep, wake up with lid closed" dance before the plug-unplug dance will cause the issue again. I can try though if hibernation is actually necessary before the screen plugging shenanegans to cause the issue (to try and get the list of steps to reliably reproduce as short as possible). I'll do a reboot now to fix the issue and report back if I can re-cause it yet again.
Comment 10 Christian Lampe 2026-02-23 20:18:57 UTC
Okay, I rebooted with only screen 2 plugged in (and ofc the internal display), the issue was not there after plugging in the 3rd screen. Then I manually reordered them, closed the settings window and unplugged the 2nd screen. Then I plugged screen 3 back in and went back into screen settings to reorder them like I want them again. Unplugging the charger switches screens 2 and 3 around again. 
So it seems to be either in `plasmashell` (which renders the backgrounds), or more likely actually in KWin (which controls the monitor ordering AFAIK, `plasmashell` only loads that ordering from KWin).
Comment 11 Zamundaaa 2026-02-23 21:02:43 UTC
Good, that narrows it down a bit. I haven't been able to replicate it so far though, neither with an autotest, nor manually.

> Set up charge state profiles on a laptop with 2 external displays
What's the exact things you've set up there? Just screen brightness changes?
Comment 12 Christian Lampe 2026-02-23 21:15:11 UTC
(In reply to Zamundaaa from comment #11)
> What's the exact things you've set up there? Just screen brightness changes?

- Screen brightness changes, 
- what the lid switch does (at low charge hibernate, in both other states sleep), 
- lid action enabled even with external screen on low battery, otherwise don't sleep if external screen connected, 
- screen and keyboard brightness, 
- duration until automatic screen brightness reduce, screen sleep, computer sleep, 
- power profile.

If you want I can upload screenshots of the exact settings, but because I doubt it'd be useful I'll only do that if you ask.
Comment 13 Christian Lampe 2026-02-23 21:18:47 UTC
(In reply to Christian Lampe from comment #10)
> […] unplugged the 2nd screen. Then I plugged screen 3 back in […]

I just noticed, I typo'd there. I meant "unplugged screen 3" in relation to how I usually want them, though it was by internal definition screen 2 in that moment; when describing plugging it back i I did write it that way. Sorry if that was a little confusing.
Comment 14 Zamundaaa 2026-02-23 22:30:23 UTC
Alright, so I think the brightness changes are the most likely cause of the problem. To change the brightness, powerdevil uses libkscreen, which is a tad bit more complex than it needs to be. It happened before that it accidentally reverted some other settings this way.

Just to be sure, can you disable the brightness actions, or just stop powerdevil completely (systemctl --user stop plasma-powerdevil), and see if the problem still happens?
Comment 15 Zamundaaa 2026-02-23 22:46:04 UTC
Alright, I managed to reproduce it. It's indeed powerdevil.
Comment 16 Bug Janitor Service 2026-02-23 23:15:20 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/8876
Comment 17 Vlad Zahorodnii 2026-02-24 07:40:21 UTC
Git commit ebefbd2903b67ff86007b302e3ef1ed02e31df1e by Vlad Zahorodnii, on behalf of Xaver Hugl.
Committed on 24/02/2026 at 06:50.
Pushed by vladz into branch 'master'.

wayland/outputdevice: schedule a done event for priority changes

M  +1    -0    src/wayland/outputdevice_v2.cpp

https://invent.kde.org/plasma/kwin/-/commit/ebefbd2903b67ff86007b302e3ef1ed02e31df1e
Comment 18 Vlad Zahorodnii 2026-02-24 13:16:55 UTC
Git commit cf3b16112e921e4a2d3669e2b0706ffb3619f88d by Vlad Zahorodnii.
Committed on 24/02/2026 at 07:42.
Pushed by vladz into branch 'Plasma/6.6'.

wayland/outputdevice: schedule a done event for priority changes


(cherry picked from commit ebefbd2903b67ff86007b302e3ef1ed02e31df1e)

Co-authored-by: Xaver Hugl <xaver.hugl@kde.org>

M  +1    -0    src/wayland/outputdevice_v2.cpp

https://invent.kde.org/plasma/kwin/-/commit/cf3b16112e921e4a2d3669e2b0706ffb3619f88d
Comment 19 Zamundaaa 2026-03-03 12:01:15 UTC
*** Bug 516954 has been marked as a duplicate of this bug. ***