summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2015-07-07 13:47:19 +0800
committerJonas Ådahl <jadahl@gmail.com>2016-02-16 19:02:48 +0800
commitbc47b19c3f7044378a525ede1ce3d873938020fd (patch)
tree1689f57b1c3de491a98a3fc3a1fd8291581f5117
parentbc1dd1cee4318a67f9e17cbe519308330fd76eeb (diff)
downloadmutter-bc47b19c3f7044378a525ede1ce3d873938020fd.tar.gz
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
-rw-r--r--src/wayland/meta-wayland-pointer.c11
1 files 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);