From 3da149dbe2f207f6b0eeaa8aa3164c8082ac1cc6 Mon Sep 17 00:00:00 2001 From: "Alex (Yowie IT MSP)" Date: Sat, 2 May 2026 19:51:20 +1000 Subject: [PATCH] Yowie IT MSP fork: patch get_cursor() for upstream issue #672 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When CURSOR_SHOWING=0 (no physical mouse on Win 11/Server 2022/headless endpoints), upstream returns Ok(None) → no cursor message ever sent on the wire → web client / native viewer renders nothing for the cursor. Patch: load IDC_ARROW so the viewer always receives a valid cursor. Hash-pinned by IconInfo so it's effectively a one-shot per session. Required for our MSP use case where a substantial fraction of endpoints are headless servers (Hyper-V hosts, Win Server 2022 with no console mouse). Bundled with OnRamp via Install-RustDeskClient binary replace. --- src/platform/windows.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/platform/windows.rs b/src/platform/windows.rs index 4c09bbe9f..66891784b 100644 --- a/src/platform/windows.rs +++ b/src/platform/windows.rs @@ -171,7 +171,17 @@ pub fn get_cursor() -> ResultType> { return Err(io::Error::last_os_error().into()); } if ci.flags & CURSOR_SHOWING == 0 { - Ok(None) + // Yowie IT MSP fork (2026-05-02): on Win 11 / Server 2022 with no + // physical mouse attached, Windows clears CURSOR_SHOWING and the + // upstream code returns None — so the connected viewer never + // receives any cursor data and headless servers show a black- + // screen-with-no-cursor in the RustDesk web client (upstream + // issue #672, unfixed 3+ years). Force-load the standard arrow + // so a valid cursor message is always sent on the wire. The + // viewer then renders the standard pointer, regardless of + // whether the endpoint has any HID hardware. Hash-pinned by + // IconInfo so it's effectively a one-shot per session. + Ok(Some(LoadCursorW(std::ptr::null_mut(), IDC_ARROW) as _)) } else { Ok(Some(ci.hCursor as _)) }