Fix Extended + Primary modes: Re-apply primary after topology changes#120
Fix Extended + Primary modes: Re-apply primary after topology changes#120
Conversation
|
@copilot investigate possible cause, are we doing the stair stepping properly in multi monitor setups, did validation fail? Why |
…ositions Co-authored-by: Nonary <27069224+Nonary@users.noreply.github.com>
The original fix only triggered when monitor positions were set, but Extended + Primary mode doesn't set positions. Now always re-applies primary when EnsurePrimary is requested, fixing the issue where Windows resets primary during setTopology with SDC_ALLOW_PATH_ORDER_CHANGES. Co-authored-by: Nonary <27069224+Nonary@users.noreply.github.com>
Found and fixed the issue! The original fix had a critical bug - it only triggered when monitor positions were explicitly set, but Extended + Primary mode doesn't set any positions. Root causes:
Fixes in commit 4366f75:
This now works for both:
Regarding "stair stepping": Windows naturally arranges monitors in a cascade when positions aren't specified. The libdisplaydevice library uses |
No, this fix doesn't affect Exclusive mode. My changes only apply when
Exclusive mode uses Issue #89 appears to be about client configuration UI defaults (selecting physical display by default even when global setting is virtual), which is a different issue from display mode application failures. If Exclusive mode is also failing to stick properly, that would need separate investigation as it's not addressed by this PR. |
|
Complete garbage suggestions. |
Extended + Primary and Extended + Primary (Isolated) modes fail to maintain virtual adapter as primary display. Windows resets primary designation when
SetDisplayConfigis called withSDC_ALLOW_PATH_ORDER_CHANGESduring topology changes.Root Cause
Windows can reset the primary display when
setTopologyis called withSDC_ALLOW_PATH_ORDER_CHANGESflag, which allows Windows to rearrange monitors. This happens regardless of whether monitor positions are explicitly set or not.Changes
Display Helper Integration
sunshine_ensure_primary_devicefield to JSON payload whenEnsurePrimaryis requested (regardless of monitor positions)Display Settings Helper
sunshine_ensure_primary_devicefrom payloadsetAsPrimaryafter topology changes completeDisplayController::set_as_primarywrapperSequence
Fix Evolution
Initial Implementation (Commit 1): Only re-applied primary when monitor positions were set
Fixed Implementation (Commit 2): Always re-applies primary for EnsurePrimary modes
Affects all Extended + Primary modes, regardless of whether monitor positions are specified.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.