wayland: Move away from meta_cursor_renderer_get_position()

Fetch the cursor renderer device, and query its position instead.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403
This commit is contained in:
Carlos Garnacho 2020-07-13 13:34:59 +02:00
parent dc022a67b0
commit 4398d63566

View File

@ -187,6 +187,7 @@ meta_wayland_cursor_surface_is_on_logical_monitor (MetaWaylandSurfaceRole *role,
META_WAYLAND_CURSOR_SURFACE (surface->role); META_WAYLAND_CURSOR_SURFACE (surface->role);
MetaWaylandCursorSurfacePrivate *priv = MetaWaylandCursorSurfacePrivate *priv =
meta_wayland_cursor_surface_get_instance_private (cursor_surface); meta_wayland_cursor_surface_get_instance_private (cursor_surface);
ClutterInputDevice *device;
graphene_point_t point; graphene_point_t point;
graphene_rect_t logical_monitor_rect; graphene_rect_t logical_monitor_rect;
@ -196,7 +197,8 @@ meta_wayland_cursor_surface_is_on_logical_monitor (MetaWaylandSurfaceRole *role,
logical_monitor_rect = logical_monitor_rect =
meta_rectangle_to_graphene_rect (&logical_monitor->rect); meta_rectangle_to_graphene_rect (&logical_monitor->rect);
point = meta_cursor_renderer_get_position (priv->cursor_renderer); device = meta_cursor_renderer_get_input_device (priv->cursor_renderer);
clutter_input_device_get_coords (device, NULL, &point);
return graphene_rect_contains_point (&logical_monitor_rect, &point); return graphene_rect_contains_point (&logical_monitor_rect, &point);
} }