[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.
This commit is contained in:
Quantum 2021-01-19 19:31:05 -05:00 committed by Geoffrey McRae
parent 115c226113
commit 6077dcc123

View File

@ -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;