context: Make ClutterContext a GObject and move to separate file

This is a step in cleaning up the Clutter context management. By making
it a GObject it's easier to add e.g. properties and features that helps
with introspection.

For now, this means the context creation is changed to go via a
"constructor" (clutter_create_context()). This is so that the global
context singleton can be mantained outsid of ClutterContext, until it
can be removed.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2016>
This commit is contained in:
Jonas Ådahl
2021-09-20 10:28:42 +02:00
committed by Marge Bot
parent 6aebd5407d
commit 501d19656e
14 changed files with 469 additions and 312 deletions

View File

@ -251,7 +251,7 @@ meta_backend_dispose (GObject *object)
g_clear_pointer (&priv->stage, clutter_actor_destroy);
g_clear_pointer (&priv->idle_manager, meta_idle_manager_free);
g_clear_object (&priv->renderer);
g_clear_pointer (&priv->clutter_context, clutter_context_free);
g_clear_pointer (&priv->clutter_context, clutter_context_destroy);
g_clear_list (&priv->gpus, g_object_unref);
G_OBJECT_CLASS (meta_backend_parent_class)->dispose (object);
@ -1181,9 +1181,10 @@ init_clutter (MetaBackend *backend,
MetaBackendSource *backend_source;
GSource *source;
priv->clutter_context = clutter_context_new (meta_clutter_backend_constructor,
backend,
error);
priv->clutter_context = clutter_create_context (CLUTTER_CONTEXT_FLAG_NONE,
meta_clutter_backend_constructor,
backend,
error);
if (!priv->clutter_context)
return FALSE;