From 558f3156dcb5718702c62fc84355c106ed9be32d Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 19 May 2023 16:16:54 +0200 Subject: [PATCH] backends/native: Fix relative motion filtering for tablet tools This was somewhat ineffective since it was applied after figuring out the x/y absolute coordinates. Change the order (filter first, then figure out abs coords), and use coordinates from the correct device while at it. Part-of: --- src/backends/native/meta-seat-impl.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/backends/native/meta-seat-impl.c b/src/backends/native/meta-seat-impl.c index 3f0fe4226..f72fdb27d 100644 --- a/src/backends/native/meta-seat-impl.c +++ b/src/backends/native/meta-seat-impl.c @@ -1300,16 +1300,17 @@ notify_relative_tool_motion_in_impl (ClutterInputDevice *input_device, device_native = META_INPUT_DEVICE_NATIVE (input_device); seat_impl = seat_impl_from_device (input_device); - x = device_native->pointer_x + dx; - y = device_native->pointer_y + dy; meta_seat_impl_filter_relative_motion (seat_impl, input_device, - seat_impl->pointer_x, - seat_impl->pointer_y, + device_native->pointer_x, + device_native->pointer_y, &dx, &dy); + x = device_native->pointer_x + dx; + y = device_native->pointer_y + dy; + event = new_absolute_motion_event (seat_impl, input_device, time_us, x, y, axes);