From a99ef7f94030afb5944ffab70d96142412b248c6 Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Wed, 22 Jul 2026 10:17:46 +0200 Subject: [PATCH] fix(windows): hw_cursor_capable must not assume an initialised display manager MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The FIRST session's Welcome runs before any backend construction (vdisplay::open happens at display prep, after the Welcome), so the capability probe's vdm() expect panicked the very first handshake of a fresh service — the client saw a dead connect and auto-wake kicked in. init() is idempotent and the driver facade is a unit struct, so the probe now initialises the manager itself. Found on-glass (.173, first Mac-client connect), fix deployed there. Co-Authored-By: Claude Fable 5 --- crates/pf-vdisplay/src/vdisplay/windows/manager.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/pf-vdisplay/src/vdisplay/windows/manager.rs b/crates/pf-vdisplay/src/vdisplay/windows/manager.rs index 197430cd..48226ff3 100644 --- a/crates/pf-vdisplay/src/vdisplay/windows/manager.rs +++ b/crates/pf-vdisplay/src/vdisplay/windows/manager.rs @@ -274,8 +274,13 @@ pub fn vdm() -> &'static VirtualDisplayManager { /// handshake-latched protocol version, opening the control device once if no session has /// opened it yet this service run (the same open every session performs anyway) — so the /// Welcome-time capability decision never guesses. `false` when the driver is missing/stale. +/// +/// The FIRST session's Welcome precedes any backend construction (`vdisplay::open` runs at +/// display prep, after the Welcome), so this must not assume an initialised manager — +/// `init` is idempotent and constructing the driver facade is free (on-glass finding: the +/// `vdm()` expect panicked the very first handshake of a fresh service). pub fn hw_cursor_capable() -> bool { - let m = vdm(); + let m = init(Box::new(crate::driver::PfVdisplayDriver)); let v = m.driver_proto.load(Ordering::Relaxed); if v != 0 { return v >= 5;