Yowie IT MSP fork: patch get_cursor() for upstream issue #672

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.
This commit is contained in:
2026-05-02 19:51:20 +10:00
parent 383a5c3478
commit 3da149dbe2
+11 -1
View File
@@ -171,7 +171,17 @@ pub fn get_cursor() -> ResultType<Option<u64>> {
return Err(io::Error::last_os_error().into()); return Err(io::Error::last_os_error().into());
} }
if ci.flags & CURSOR_SHOWING == 0 { 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 { } else {
Ok(Some(ci.hCursor as _)) Ok(Some(ci.hCursor as _))
} }