[client] spice/wayland: use correct coordinate space

This will now correctly respect the cursor hotspot.
This commit is contained in:
Quantum 2021-01-12 16:22:03 -05:00 committed by Geoffrey McRae
parent ab96f77d9e
commit 95205ca967

View File

@ -920,8 +920,12 @@ static void guestCurToLocal(struct DoublePoint *local)
// capture mode.
static void handleMouseWayland()
{
double ex = (g_cursor.pos.x - g_cursor.guest.x) / g_cursor.dpiScale;
double ey = (g_cursor.pos.y - g_cursor.guest.y) / g_cursor.dpiScale;
/* translate the guests position to our coordinate space */
struct DoublePoint local;
guestCurToLocal(&local);
double ex = (g_cursor.pos.x - local.x) / g_cursor.dpiScale;
double ey = (g_cursor.pos.y - local.y) / g_cursor.dpiScale;
int x, y;
cursorToInt(ex, ey, &x, &y);