Bug 478994 - A disabled screen disconnecting and reconnecting itself causes display layout updates
Summary: A disabled screen disconnecting and reconnecting itself causes display layout...
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: platform-drm (show other bugs)
Version: 5.27.10
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: multiscreen
Depends on:
Blocks:
 
Reported: 2023-12-25 14:10 UTC by qlum
Modified: 2024-07-17 15:05 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
output of drm_info (197.45 KB, text/plain)
2024-01-11 19:11 UTC, qlum
Details
KWin log (9.59 KB, text/plain)
2024-01-11 19:11 UTC, qlum
Details

Note You need to log in before you can comment on or make changes to this bug.
Description qlum 2023-12-25 14:10:40 UTC
SUMMARY
Whenever a disabled screen disconnects / reconnects itself, it causes the layout to update.
Some monitors, such as in my case the Gigabyte G27Q will attempt to disconnect and reconnect every 10 seconds or so when disabled. It will do so for roughly a minute or so.

STEPS TO REPRODUCE
1. have at least 2 display of which one with the behavior above
2. disable the display with said behavior, alternatively manually unplug the monitor

OBSERVED RESULT
Screen / panel layout gets updated, causing stutters / minor flickering.

EXPECTED RESULT
The display layout does not get updated, as none of the active displays encounter changes.
This is especially problematic if you want to re-enable the displays, as it imposes a deadline of less than 10 seconds to make changes.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: kernel 6.7
KDE Plasma Version:  5.91
KDE Frameworks Version:  5.247.0
Qt Version: 6.7

ADDITIONAL INFORMATION
I have had this issue for a while, but it was masked by other problems / with reconnecting and disconnecting screens.
Comment 1 Dennis 2023-12-27 15:31:34 UTC
I can't reproduce. What I did was:
1. have an external monitor (Dell U2718Q) connected through docking Dell TB16 on a XPS13 laptop. External is configured as main.
2. have both displays connected
3. Go to settings, display config, unselect "Enabled" on the external monitor. 
4. The screen focusses on the built-in screen as expected. No flickering on unexpected behaviour. The monitor tries to find a signal and finding none, it goes into sleep mode.
5. Wait until the display config times out as it does not get a confirmation (takes 15secs). 
6. the system defaults to original settings, which has the external display as main and the monitor comes out of sleep mode.

Let me know if I tested correctly or what I should do. I don't fully comprehend what the G27Q is doing.

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.91.90
KDE Frameworks Version: 5.248.0
Qt Version: 6.6.1
Kernel Version: 6.2.0-39-generic (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-8565U CPU @ 1.80GHz
Memory: 15,3 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 620
Manufacturer: Dell Inc.
Product Name: XPS 13 9380
Comment 2 qlum 2023-12-28 21:44:37 UTC
Please note the issue on KDE's side is not the monitor's behavior which is odd and probably rare. 
The update of the layout will not cause huge issues, but panels do get redrawn which is visible, and it can make re-enabling more difficult as you only have until the next cycle to click on enable and apply.
It may cause other issues at times as well, in some unknown edge-cases.
Furthermore, I don't know if there is any technical reason why the layout needs to be updated at all when an already disabled display gets disconnected or reconnected, after all it is not being used either way.
Comment 3 Nate Graham 2024-01-11 17:57:21 UTC
> Some monitors, such as in my case the Gigabyte G27Q will attempt to disconnect and reconnect
> every 10 seconds or so when disabled
Who on earth approved this feature!?! >:C

It's almost like we need a quirks database of known stupid monitors so we can work around their bad behavior...
Comment 4 Zamundaaa 2024-01-11 18:04:51 UTC
Please attach the output of drm_info and your KWin log (journalctl --user-unit plasma-kwin_wayland --boot 0)
Comment 5 qlum 2024-01-11 19:11:28 UTC
Created attachment 164822 [details]
output of drm_info
Comment 6 qlum 2024-01-11 19:11:50 UTC
Created attachment 164823 [details]
KWin log