From e35b6991e2eca97c78bdff018162498df10c9c38 Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Sun, 5 Jul 2026 09:41:20 +0000 Subject: [PATCH] fix(vdisplay/windows): topology=primary force-extends to reactivate the physical MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- crates/punktfunk-host/src/vdisplay/windows/manager.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/punktfunk-host/src/vdisplay/windows/manager.rs b/crates/punktfunk-host/src/vdisplay/windows/manager.rs index e60aa20..11ff0b0 100644 --- a/crates/punktfunk-host/src/vdisplay/windows/manager.rs +++ b/crates/punktfunk-host/src/vdisplay/windows/manager.rs @@ -648,6 +648,14 @@ impl VirtualDisplayManager { ccd_saved = unsafe { isolate_displays_ccd(added.target_id) }; } 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) }; } Topology::Extend | Topology::Auto => {