Repository navigation
fix(windows): recover display layout after undocking - #298
Conversation
|
Hello, thanks for the PR! I review this with GPT 6 Sol, extra high. I found two issues:
|
|
Thanks! Both fixed in f819cd6:
Windows run: https://github.com/jdvmi00/libdisplaydevice/actions/runs/36352876700 |
ReenigneArcher
left a comment
There was a problem hiding this comment.
Thanks for adding regression coverage for the earlier feedback. The updated code handles those tested cases, but two recovery paths still need attention before merge. I left details inline.
|
Thanks! Both fixed in db3ea02, 727005c and 1be1907:
Windows run: https://github.com/jdvmi00/libdisplaydevice/actions/runs/36584993163 |
… unplugged Keep surviving clone groups intact while staging recovery.
…ups during recovery Retain the original mode, HDR and primary settings of displays that are still unplugged after a topology recovery, so redocking can restore them. Extend an active clone member's group in place while staging recovery instead of adding the other members as separate sources.
…s while a display is away Base the retained record on the recovered layout so applying settings still works, carry the pending entries through an apply, and stage clone groups within the two-display limit.
… modified topology
… away Track the display to restore while the original primary is unavailable, so an EnsurePrimary session can be reverted without leaving its display primary.
6756ddf to
f72c62a
Compare
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #298 +/- ##
==========================================
+ Coverage 79.98% 80.86% +0.88%
==========================================
Files 63 63
Lines 3412 3680 +268
Branches 1550 1694 +144
==========================================
+ Hits 2729 2976 +247
+ Misses 333 331 -2
- Partials 350 373 +23
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Harness.
|



Description
I ran into this while using Sunshine with a docked Windows laptop, lid closed, and a virtual display selected with
ensure_only_display. Unplugging the dock during a stream and then disconnecting leaves the original monitor unavailable. Opening the lid turns the panel on, but the virtual display stays enabled and the old recovery state keeps being retried.This lets restoration fall back to surviving original displays, or a built-in panel if none remain. It checks that the replacement is active before removing displays enabled by the session, and only clears the recovery state after verifying the final layout. With the lid closed and no physical display available, recovery stays pending.
There was a second part to the same repro: the streaming layout became Windows' saved docked layout, so redocking brought back the virtual display instead of the external monitor.
WinDisplayDevicenow has an optionalsave_to_databaseargument so callers can make temporary CCD changes. The default stays unchanged. The companion Sunshine change is LizardByte/Sunshine#5625.Testing:
masterbase.QDC_DATABASE_CURRENTalso confirmed the saved docked layout stayed unchanged while streaming.The hardware trial used Sunshine v2026.516.143833. This PR ports those changes to current
master. The Windows run above is in my fork; upstream Actions still need maintainer approval to run.Screenshot
Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage
See our AI usage policy.