fix(vdisplay/windows): topology=primary force-extends to reactivate the physical

Root cause: on a headless box the IDD auto-activates as the SOLE display, so
QueryDisplayConfig sees only the virtual — the physical is already deactivated
before set_virtual_primary_ccd runs (no physical to keep). Force EXTEND first to
reactivate every connected display alongside the virtual, then reposition to make
the virtual primary, keeping the physical active.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-05 09:41:20 +00:00
parent 913f6ce659
commit e35b6991e2
@@ -648,6 +648,14 @@ impl VirtualDisplayManager {
ccd_saved = unsafe { isolate_displays_ccd(added.target_id) }; ccd_saved = unsafe { isolate_displays_ccd(added.target_id) };
} }
Topology::Primary => { Topology::Primary => {
// The IDD auto-activates as the SOLE display on a headless box, so the
// physical (if present) is deactivated and QueryDisplayConfig sees only the
// virtual. Force EXTEND first to (re)activate every CONNECTED display
// alongside the virtual, THEN reposition to make the virtual primary — so the
// physical stays active. (The bring-up above only force-EXTENDs when the
// virtual FAILS to auto-resolve; here it resolved, so we do it explicitly.)
unsafe { force_extend_topology() };
thread::sleep(Duration::from_millis(300));
ccd_saved = unsafe { set_virtual_primary_ccd(added.target_id) }; ccd_saved = unsafe { set_virtual_primary_ccd(added.target_id) };
} }
Topology::Extend | Topology::Auto => { Topology::Extend | Topology::Auto => {