From f73ecf6000df50d39342f408cbd7d0ed0b088831 Mon Sep 17 00:00:00 2001 From: Mariusz Bialonczyk Date: Tue, 2 Jan 2024 06:41:08 +0100 Subject: [PATCH] [uwac] input: pointer_handle_motion: take a scale into account --- uwac/libuwac/uwac-input.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/uwac/libuwac/uwac-input.c b/uwac/libuwac/uwac-input.c index e853a63c1..e23d8de5a 100644 --- a/uwac/libuwac/uwac-input.c +++ b/uwac/libuwac/uwac-input.c @@ -824,10 +824,11 @@ static void pointer_handle_motion(void* data, struct wl_pointer* pointer, uint32 UwacWindow* window = input->pointer_focus; - int sx_i = wl_fixed_to_int(sx_w); - int sy_i = wl_fixed_to_int(sy_w); - double sx_d = wl_fixed_to_double(sx_w); - double sy_d = wl_fixed_to_double(sy_w); + int scale = window->display->actual_scale; + int sx_i = wl_fixed_to_int(sx_w) * scale; + int sy_i = wl_fixed_to_int(sy_w) * scale; + double sx_d = wl_fixed_to_double(sx_w) * scale; + double sy_d = wl_fixed_to_double(sy_w) * scale; if (!window || (sx_i < 0) || (sy_i < 0)) return;