From bc47b19c3f7044378a525ede1ce3d873938020fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 7 Jul 2015 13:47:19 +0800 Subject: [PATCH] wayland: Use the event coordinates when sending pointer motion events The x/y coordinates of the ClutterInputDevice were not the ones which was the result of this event but whatever event was queued the last. The correct coordinates can, however, be found in the event itself, so lets use those. https://bugzilla.gnome.org/show_bug.cgi?id=744104 --- src/wayland/meta-wayland-pointer.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c index 09d0e986a..4fb32bbdf 100644 --- a/src/wayland/meta-wayland-pointer.c +++ b/src/wayland/meta-wayland-pointer.c @@ -326,19 +326,22 @@ meta_wayland_pointer_send_motion (MetaWaylandPointer *pointer, { struct wl_resource *resource; uint32_t time; - wl_fixed_t sx, sy; + float sx, sy; if (!pointer->focus_client) return; time = clutter_event_get_time (event); - meta_wayland_pointer_get_relative_coordinates (pointer, - pointer->focus_surface, + meta_wayland_surface_get_relative_coordinates (pointer->focus_surface, + event->motion.x, + event->motion.y, &sx, &sy); wl_resource_for_each (resource, &pointer->focus_client->pointer_resources) { - wl_pointer_send_motion (resource, time, sx, sy); + wl_pointer_send_motion (resource, time, + wl_fixed_from_double (sx), + wl_fixed_from_double (sy)); } meta_wayland_pointer_send_relative_motion (pointer, event);