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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3012>
This commit is contained in:
Carlos Garnacho 2023-05-19 16:16:54 +02:00 committed by Marge Bot
parent 26d13f4269
commit 558f3156dc

View File

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