From a150225a598ea4e33bbfcabbd6568c421bc3eb19 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 30 Jun 2017 14:06:26 +0200 Subject: [PATCH] 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 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/wayland/meta-wayland-tablet-tool.c b/src/wayland/meta-wayland-tablet-tool.c index 4cd865fa8..6c193526c 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);