backends: Move away from meta_cursor_renderer_get_position()

We are moving onto relying fully on the seat cursor position. As
this focuses (thus far?) on mouse pointers only, use the cursor
tracker as a convenient shortcut.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
This commit is contained in:
Carlos Garnacho
2020-07-13 12:28:46 +02:00
committed by Marge Bot
parent de0848b28b
commit 247613d26d
3 changed files with 15 additions and 7 deletions

View File

@ -189,9 +189,11 @@ is_cursor_in_stream (MetaScreenCastMonitorStreamSrc *monitor_src)
}
else
{
MetaCursorTracker *cursor_tracker =
meta_backend_get_cursor_tracker (backend);
graphene_point_t cursor_position;
cursor_position = meta_cursor_renderer_get_position (cursor_renderer);
meta_cursor_tracker_get_pointer (cursor_tracker, &cursor_position, NULL);
return graphene_rect_contains_point (&logical_monitor_rect,
&cursor_position);
}
@ -665,7 +667,7 @@ meta_screen_cast_monitor_stream_src_set_cursor_metadata (MetaScreenCastStreamSrc
else
view_scale = 1.0;
cursor_position = meta_cursor_renderer_get_position (cursor_renderer);
meta_cursor_tracker_get_pointer (cursor_tracker, &cursor_position, NULL);
cursor_position.x -= logical_monitor_rect.origin.x;
cursor_position.y -= logical_monitor_rect.origin.y;
cursor_position.x *= view_scale;