[mutter] wayland: Use the event coordinates when sending pointer motion events



commit bc47b19c3f7044378a525ede1ce3d873938020fd
Author: Jonas Ådahl <jadahl gmail com>
Date:   Tue Jul 7 13:47:19 2015 +0800

    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 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c
index 09d0e98..4fb32bb 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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]