[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.
This commit is contained in:
Geoffrey McRae committed 2025-09-07 20:24:17 +10:00
1 parent da154a5591
commit 01cae959d8
1 file changed
+12
+12
View File
@@ -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;