[mutter] context: Add 'notify_ready()' vfunc and method



commit 2e784e23a29bf7ab323d31abda4d277a772c342a
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Tue Mar 2 12:07:10 2021 +0100

    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>

 src/core/meta-context-private.h | 2 ++
 src/core/meta-context.c         | 6 ++++++
 src/meta/meta-context.h         | 3 +++
 src/tests/meta-context-test.c   | 6 ++++++
 4 files changed, 17 insertions(+)
---
diff --git a/src/core/meta-context-private.h b/src/core/meta-context-private.h
index 254403aee7..8a3a6171ed 100644
--- a/src/core/meta-context-private.h
+++ b/src/core/meta-context-private.h
@@ -41,6 +41,8 @@ struct _MetaContextClass
 
   MetaBackend * (* create_backend) (MetaContext  *context,
                                     GError      **error);
+
+  void (* notify_ready) (MetaContext *context);
 };
 
 #endif /* META_CONTEXT_PRIVATE_H */
diff --git a/src/core/meta-context.c b/src/core/meta-context.c
index 8797f7dacc..9cd12fe216 100644
--- a/src/core/meta-context.c
+++ b/src/core/meta-context.c
@@ -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)
 {
diff --git a/src/meta/meta-context.h b/src/meta/meta-context.h
index 1c612c49ac..0d91c2cc67 100644
--- a/src/meta/meta-context.h
+++ b/src/meta/meta-context.h
@@ -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);
 
diff --git a/src/tests/meta-context-test.c b/src/tests/meta-context-test.c
index c5897af2f5..216c09192c 100644
--- a/src/tests/meta-context-test.c
+++ b/src/tests/meta-context-test.c
@@ -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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]