[mutter] cursor-renderer: Keep ref to displayed cursor sprite
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] cursor-renderer: Keep ref to displayed cursor sprite
- Date: Thu, 6 Aug 2020 16:26:40 +0000 (UTC)
commit a10f35c6133f2351aca1f6f6d0ab7703327c678f
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Fri Jul 31 21:10:34 2020 +0200
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
src/backends/meta-cursor-renderer.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/backends/meta-cursor-renderer.c b/src/backends/meta-cursor-renderer.c
index eacbf67244..d3ea5ec216 100644
--- a/src/backends/meta-cursor-renderer.c
+++ b/src/backends/meta-cursor-renderer.c
@@ -238,6 +238,8 @@ meta_cursor_renderer_finalize (GObject *object)
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);
}
@@ -362,7 +364,7 @@ meta_cursor_renderer_set_cursor (MetaCursorRenderer *renderer,
if (priv->displayed_cursor == cursor_sprite)
return;
- priv->displayed_cursor = cursor_sprite;
+ g_set_object (&priv->displayed_cursor, cursor_sprite);
meta_cursor_renderer_update_cursor (renderer, cursor_sprite);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]