From 6077dcc123cc1baea393d6417fa1d07282c74db3 Mon Sep 17 00:00:00 2001 From: Quantum Date: Tue, 19 Jan 2021 19:31:05 -0500 Subject: [PATCH] [client] spice/wayland: fix jitter when moving the cursor slowly It does not make sense to accumulate fractional error in non-capture mode as you know exactly where the cursor is supposed to be, at least on Wayland. On Wayland, we base movements on the current guest position and desired target position, and the accumulated errors only skew our movements. --- client/src/main.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/client/src/main.c b/client/src/main.c index 9503a5b6..a5e297d5 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -1438,11 +1438,8 @@ void app_handleMouseBasic() struct DoublePoint local; guestCurToLocal(&local); - double lx = (px - local.x) / g_cursor.dpiScale; - double ly = (py - local.y) / g_cursor.dpiScale; - - int x, y; - cursorToInt(lx, ly, &x, &y); + int x = (int) round((px - local.x) / g_cursor.dpiScale); + int y = (int) round((py - local.y) / g_cursor.dpiScale); g_cursor.guest.x += x; g_cursor.guest.y += y;