cursor-sprite: Register all cursor sprites with the cursor tracker

This will later be used to invalidate GPU state when closing device
nodes.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2147>
This commit is contained in:
Jonas Ådahl
2021-11-15 14:24:53 +01:00
committed by Marge Bot
parent c498ae337f
commit 25ed64b61d
13 changed files with 141 additions and 14 deletions

View File

@ -250,6 +250,9 @@ meta_wayland_cursor_surface_constructed (GObject *object)
META_WAYLAND_SURFACE_ROLE (cursor_surface);
MetaWaylandSurface *surface =
meta_wayland_surface_role_get_surface (surface_role);
MetaWaylandCompositor *compositor = surface->compositor;
MetaBackend *backend = meta_context_get_backend (compositor->context);
MetaCursorTracker *cursor_tracker = meta_backend_get_cursor_tracker (backend);
MetaWaylandBuffer *buffer;
buffer = meta_wayland_surface_get_buffer (surface);
@ -262,7 +265,8 @@ meta_wayland_cursor_surface_constructed (GObject *object)
meta_wayland_surface_ref_buffer_use_count (surface);
}
priv->cursor_sprite = meta_cursor_sprite_wayland_new (surface);
priv->cursor_sprite = meta_cursor_sprite_wayland_new (surface,
cursor_tracker);
meta_cursor_sprite_set_prepare_func (META_CURSOR_SPRITE (priv->cursor_sprite),
(MetaCursorPrepareFunc) cursor_sprite_prepare_at,
cursor_surface);