[mutter] wayland: Base tablet tool coordinates on the current event



commit 529e5adb2ed4b1f22d485ab9944a7948a7e00b01
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Jun 30 14:06:26 2017 +0200

    wayland: Base tablet tool coordinates on the current event
    
    Instead of the last device position. This was copied a little bit too
    straight from MetaWaylandPointer.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=783535

 src/wayland/meta-wayland-tablet-tool.c |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)
---
diff --git a/src/wayland/meta-wayland-tablet-tool.c b/src/wayland/meta-wayland-tablet-tool.c
index 4cd865f..6c19352 100644
--- a/src/wayland/meta-wayland-tablet-tool.c
+++ b/src/wayland/meta-wayland-tablet-tool.c
@@ -621,17 +621,16 @@ repick_for_event (MetaWaylandTabletTool *tool,
 
 static void
 meta_wayland_tablet_tool_get_relative_coordinates (MetaWaylandTabletTool *tool,
-                                                   ClutterInputDevice    *device,
+                                                   const ClutterEvent    *event,
                                                    MetaWaylandSurface    *surface,
                                                    wl_fixed_t            *sx,
                                                    wl_fixed_t            *sy)
 {
-  float xf = 0.0f, yf = 0.0f;
-  ClutterPoint pos;
+  float xf, yf;
 
-  clutter_input_device_get_coords (device, NULL, &pos);
+  clutter_event_get_coords (event, &xf, &yf);
   clutter_actor_transform_stage_point (CLUTTER_ACTOR (meta_surface_actor_get_texture 
(surface->surface_actor)),
-                                       pos.x, pos.y, &xf, &yf);
+                                       xf, yf, &xf, &yf);
 
   *sx = wl_fixed_from_double (xf) / surface->scale;
   *sy = wl_fixed_from_double (yf) / surface->scale;
@@ -642,11 +641,9 @@ broadcast_motion (MetaWaylandTabletTool *tool,
                   const ClutterEvent    *event)
 {
   struct wl_resource *resource;
-  ClutterInputDevice *device;
   wl_fixed_t sx, sy;
 
-  device = clutter_event_get_source_device (event);
-  meta_wayland_tablet_tool_get_relative_coordinates (tool, device,
+  meta_wayland_tablet_tool_get_relative_coordinates (tool, event,
                                                      tool->focus_surface,
                                                      &sx, &sy);
 


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