mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 13:37:22 +00:00
[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:
parent
115c226113
commit
6077dcc123
@ -1438,11 +1438,8 @@ void app_handleMouseBasic()
|
|||||||
struct DoublePoint local;
|
struct DoublePoint local;
|
||||||
guestCurToLocal(&local);
|
guestCurToLocal(&local);
|
||||||
|
|
||||||
double lx = (px - local.x) / g_cursor.dpiScale;
|
int x = (int) round((px - local.x) / g_cursor.dpiScale);
|
||||||
double ly = (py - local.y) / g_cursor.dpiScale;
|
int y = (int) round((py - local.y) / g_cursor.dpiScale);
|
||||||
|
|
||||||
int x, y;
|
|
||||||
cursorToInt(lx, ly, &x, &y);
|
|
||||||
|
|
||||||
g_cursor.guest.x += x;
|
g_cursor.guest.x += x;
|
||||||
g_cursor.guest.y += y;
|
g_cursor.guest.y += y;
|
||||||
|
Loading…
Reference in New Issue
Block a user