From 01cae959d8d48648e586dcebb593a56a8c0645f3 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sun, 7 Sep 2025 20:24:17 +1000 Subject: [PATCH] [client] core: workaround windows mouse information problem Under windows there is no cursor enabled at all until it has been moved for the fist time by the user. If our cursor information is invalid we assume that this has occured and induce a wiggle to force windows to create the cursor. --- client/src/core.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/client/src/core.c b/client/src/core.c index 30698031..d860d375 100644 --- a/client/src/core.c +++ b/client/src/core.c @@ -479,7 +479,19 @@ void core_handleMouseNormal(double ex, double ey) { // prevent cursor handling outside of capture if the position is not known if (!g_cursor.guest.valid) + { + if (app_guestIsWindows()) + { + // wiggle the mouse when the guest has not provided any information, we need + // to do this because windows doesn't enable a cursor at all until it has + // been moved for the first time. + if (!purespice_mouseMotion(1, 1)) + DEBUG_ERROR("failed to send mouse motion message"); + if (!purespice_mouseMotion(-1, -1)) + DEBUG_ERROR("failed to send mouse motion message"); + } return; + } if (g_cursor.realigning) return;