Bug 460247

Summary: "Do not disturb" mode is on when I log in because "screens are mirrored" but they are not
Product: [Plasma] KScreen Reporter: Matej Mrenica <matejm98mthw>
Component: commonAssignee: kscreen-bugs-null <kscreen-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: grannie, kde, nate, piotr.mierzwinski, ready2rumbel, xaver.hugl
Priority: NOR Keywords: regression
Version: git-stable-Plasma/5.26   
Target Milestone: 1.0   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 5.26.1
Sentry Crash Report:

Description Matej Mrenica 2022-10-11 15:26:18 UTC
STEPS TO REPRODUCE
1. Two screens: laptop + external monitor
2. Only external monitor is on 

OBSERVED RESULT
When you log in it will say dnd mode is on because screens are mirrored

EXPECTED RESULT
Only one screen is on so they cannot be mirrored and thus there is no reason for dnd to be on.

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.26.0
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.6

ADDITIONAL INFORMATION
Only on Wayland
Comment 1 Nate Graham 2022-10-12 16:00:32 UTC
I can reproduce this with an external screen plugged into a laptop and the laptop screen disabled. Internally, KScreen's model says that the laptop screen is enabled, even though it's not. As a result, it appears in the region where you can arrange screens, and becomes overlapped by the external screen. The notifications code sees the overlap and believes it to be mirroring (because that's how KScreen represents mirroring) and enables DND mode.

Moving back to KScreen as I believe this is a KScreen bug. The internal screen should not be marked internally as enabled when it is not.
Comment 2 ready2rumbel 2022-10-13 17:28:03 UTC
I was going to submit a report on this but it seems to have been determined pretty quickly (which is good). More so, when this happens, it's not possible to re-enable the laptop monitor. While the monitor is powered off, yet toggled on in display settings, unchecking -> apply -> recheck -> apply doesn't power the monitor back on. More so, assuming one disables the laptop monitor, applies the change, closes and reopens the display settings window, it's reset back to enabled.

The only way, at this point, to "reset" everything and have the laptop monitor powered back on is to delete all entries in .local/share/kscreen/ and reboot.
Comment 3 David Edmundson 2022-10-14 09:12:19 UTC
*** Bug 432873 has been marked as a duplicate of this bug. ***
Comment 4 Bug Janitor Service 2022-10-14 09:24:15 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/3050
Comment 5 Vlad Zahorodnii 2022-10-14 09:49:20 UTC
Git commit 71bcbf852e6d4434b56dba88f3a0146d80648e79 by Vlad Zahorodnii.
Committed on 14/10/2022 at 09:28.
Pushed by vladz into branch 'master'.

wayland: Sync output device's enabled property

The output can be already disabled when the output device is created.

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

https://invent.kde.org/plasma/kwin/commit/71bcbf852e6d4434b56dba88f3a0146d80648e79
Comment 6 Vlad Zahorodnii 2022-10-14 09:49:43 UTC
Git commit ff28dd06936d733ac6d65f41669b1331fa28d1cc by Vlad Zahorodnii.
Committed on 14/10/2022 at 09:49.
Pushed by vladz into branch 'Plasma/5.26'.

wayland: Sync output device's enabled property

The output can be already disabled when the output device is created.


(cherry picked from commit 71bcbf852e6d4434b56dba88f3a0146d80648e79)

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

https://invent.kde.org/plasma/kwin/commit/ff28dd06936d733ac6d65f41669b1331fa28d1cc
Comment 7 ready2rumbel 2022-10-14 13:48:01 UTC
That fixed it. :) Cheers!
Comment 8 Nate Graham 2023-04-28 05:08:22 UTC
*** Bug 425186 has been marked as a duplicate of this bug. ***
Comment 9 Nate Graham 2023-04-28 05:08:35 UTC
*** Bug 418185 has been marked as a duplicate of this bug. ***