clutter/backend/native: Don't double manage stage implementation

The stage owns the "stage window", so don't double manage it in
MetaClutterBackendNative, as that means it'd be double-destroyed if the
stage would be destroyed.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1775>
This commit is contained in:
Jonas Ådahl
2021-03-11 21:46:10 +01:00
committed by Marge Bot
parent c016437857
commit 5aa43ec6c4
4 changed files with 10 additions and 30 deletions

View File

@ -56,21 +56,11 @@ struct _MetaClutterBackendNative
ClutterBackend parent;
MetaSeatNative *main_seat;
MetaStageNative *stage_native;
};
G_DEFINE_TYPE (MetaClutterBackendNative, meta_clutter_backend_native,
CLUTTER_TYPE_BACKEND)
MetaStageNative *
meta_clutter_backend_native_get_stage_native (ClutterBackend *clutter_backend)
{
MetaClutterBackendNative *clutter_backend_native =
META_CLUTTER_BACKEND_NATIVE (clutter_backend);
return clutter_backend_native->stage_native;
}
static CoglRenderer *
meta_clutter_backend_native_get_renderer (ClutterBackend *clutter_backend,
GError **error)
@ -86,16 +76,10 @@ meta_clutter_backend_native_create_stage (ClutterBackend *clutter_backend,
ClutterStage *wrapper,
GError **error)
{
MetaClutterBackendNative *clutter_backend_native =
META_CLUTTER_BACKEND_NATIVE (clutter_backend);
g_assert (!clutter_backend_native->stage_native);
clutter_backend_native->stage_native = g_object_new (META_TYPE_STAGE_NATIVE,
"backend", clutter_backend,
"wrapper", wrapper,
NULL);
return CLUTTER_STAGE_WINDOW (clutter_backend_native->stage_native);
return g_object_new (META_TYPE_STAGE_NATIVE,
"backend", clutter_backend,
"wrapper", wrapper,
NULL);
}
static void
@ -144,7 +128,6 @@ meta_clutter_backend_native_finalize (GObject *object)
META_CLUTTER_BACKEND_NATIVE (object);
g_clear_object (&clutter_backend_native->main_seat);
g_clear_object (&clutter_backend_native->stage_native);
G_OBJECT_CLASS (meta_clutter_backend_native_parent_class)->finalize (object);
}