context: Add 'notify_ready()' vfunc and method

This intends to replace the call to `meta_register_with_session()` that
deals with X11 session management, and is called when the user is
"ready". In thet test context, doing that makes no sense, so make it a
no-op.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861>
This commit is contained in:
Jonas Ådahl 2021-03-02 12:07:10 +01:00
parent 4cd1154b3d
commit 2e784e23a2
4 changed files with 17 additions and 0 deletions

View File

@ -41,6 +41,8 @@ struct _MetaContextClass
MetaBackend * (* create_backend) (MetaContext *context,
GError **error);
void (* notify_ready) (MetaContext *context);
};
#endif /* META_CONTEXT_PRIVATE_H */

View File

@ -66,6 +66,12 @@ meta_context_set_plugin_name (MetaContext *context,
priv->plugin_name = g_strdup (plugin_name);
}
void
meta_context_notify_ready (MetaContext *context)
{
META_CONTEXT_GET_CLASS (context)->notify_ready (context);
}
static MetaCompositorType
meta_context_get_compositor_type (MetaContext *context)
{

View File

@ -51,6 +51,9 @@ META_EXPORT
gboolean meta_context_run_main_loop (MetaContext *context,
GError **error);
META_EXPORT
void meta_context_notify_ready (MetaContext *context);
META_EXPORT
void meta_context_terminate (MetaContext *context);

View File

@ -136,6 +136,11 @@ meta_context_test_create_backend (MetaContext *context,
g_assert_not_reached ();
}
static void
meta_context_test_notify_ready (MetaContext *context)
{
}
MetaContext *
meta_create_test_context (MetaContextTestType type)
{
@ -158,6 +163,7 @@ meta_context_test_class_init (MetaContextTestClass *klass)
context_class->get_compositor_type = meta_context_test_get_compositor_type;
context_class->setup = meta_context_test_setup;
context_class->create_backend = meta_context_test_create_backend;
context_class->notify_ready = meta_context_test_notify_ready;
}
static void