cursor-renderer: Keep ref to displayed cursor sprite

If it'd end up beig the XCursor sprite, it'll be unref:ed by the cursor
tracker when receiving a XFixesCursorNotify:XFixesDisplayCursorNotify
X11 event.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1391
This commit is contained in:
Jonas Ådahl 2020-07-31 21:10:34 +02:00
parent 5f5ef704fc
commit a10f35c613

View File

@ -238,6 +238,8 @@ meta_cursor_renderer_finalize (GObject *object)
g_clear_signal_handler (&priv->after_paint_handler_id, stage); g_clear_signal_handler (&priv->after_paint_handler_id, stage);
g_clear_object (&priv->displayed_cursor);
G_OBJECT_CLASS (meta_cursor_renderer_parent_class)->finalize (object); G_OBJECT_CLASS (meta_cursor_renderer_parent_class)->finalize (object);
} }
@ -362,7 +364,7 @@ meta_cursor_renderer_set_cursor (MetaCursorRenderer *renderer,
if (priv->displayed_cursor == cursor_sprite) if (priv->displayed_cursor == cursor_sprite)
return; return;
priv->displayed_cursor = cursor_sprite; g_set_object (&priv->displayed_cursor, cursor_sprite);
meta_cursor_renderer_update_cursor (renderer, cursor_sprite); meta_cursor_renderer_update_cursor (renderer, cursor_sprite);
} }