[mutter] main: Remove meta_test_init()



commit fe0ce2814e34ea9591df8cd6ffaa62c1ed4c43d4
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Wed Mar 3 12:10:06 2021 +0100

    main: Remove meta_test_init()
    
    This was the last user of the configuration override API, so that goes
    as well.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861>

 src/core/main-private.h |   7 ----
 src/core/main.c         | 107 +++---------------------------------------------
 src/meta/main.h         |   3 --
 3 files changed, 5 insertions(+), 112 deletions(-)
---
diff --git a/src/core/main-private.h b/src/core/main-private.h
index eb07cf128c..95eee45713 100644
--- a/src/core/main-private.h
+++ b/src/core/main-private.h
@@ -21,7 +21,6 @@
 #define META_MAIN_PRIVATE_H
 
 #include "core/util-private.h"
-#include "meta/meta-enums.h"
 
 typedef enum _MetaX11DisplayPolicy
 {
@@ -30,12 +29,6 @@ typedef enum _MetaX11DisplayPolicy
   META_X11_DISPLAY_POLICY_DISABLED,
 } MetaX11DisplayPolicy;
 
-META_EXPORT_TEST
-void meta_override_compositor_configuration (MetaCompositorType compositor_type,
-                                             GType              backend_gtype,
-                                             const char        *first_property_name,
-                                             ...);
-
 META_EXPORT_TEST
 MetaX11DisplayPolicy meta_get_x11_display_policy (void);
 
diff --git a/src/core/main.c b/src/core/main.c
index 3c47b5aa24..9fe0bc72ee 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -661,66 +661,6 @@ calculate_compositor_configuration (MetaCompositorType  *compositor_type,
     }
 }
 
-static gboolean _compositor_configuration_overridden = FALSE;
-static MetaCompositorType _compositor_type_override;
-static GType _backend_gtype_override;
-static GArray *_backend_property_names;
-static GArray *_backend_property_values;
-
-void
-meta_override_compositor_configuration (MetaCompositorType compositor_type,
-                                        GType              backend_gtype,
-                                        const char        *first_property_name,
-                                        ...)
-{
-  va_list var_args;
-  GArray *names;
-  GArray *values;
-  GObjectClass *object_class;
-  const char *property_name;
-
-  names = g_array_new (FALSE, FALSE, sizeof (const char *));
-  values = g_array_new (FALSE, FALSE, sizeof (GValue));
-  g_array_set_clear_func (values, (GDestroyNotify) g_value_unset);
-
-  object_class = g_type_class_ref (backend_gtype);
-
-  property_name = first_property_name;
-
-  va_start (var_args, first_property_name);
-
-  while (property_name)
-    {
-      GValue value = G_VALUE_INIT;
-      GParamSpec *pspec;
-      GType ptype;
-      char *error = NULL;
-
-      pspec = g_object_class_find_property (object_class,
-                                            property_name);
-      g_assert (pspec);
-
-      ptype = G_PARAM_SPEC_VALUE_TYPE (pspec);
-      G_VALUE_COLLECT_INIT (&value, ptype, var_args, 0, &error);
-      g_assert (!error);
-
-      g_array_append_val (names, property_name);
-      g_array_append_val (values, value);
-
-      property_name = va_arg (var_args, const char *);
-    }
-
-  va_end (var_args);
-
-  g_type_class_unref (object_class);
-
-  _compositor_configuration_overridden = TRUE;
-  _compositor_type_override = compositor_type;
-  _backend_gtype_override = backend_gtype;
-  _backend_property_names = names;
-  _backend_property_values = values;
-}
-
 /**
  * meta_init: (skip)
  *
@@ -756,22 +696,11 @@ meta_init (void)
 
   meta_init_debug_utils ();
 
-  if (_compositor_configuration_overridden)
-    {
-      compositor_type = _compositor_type_override;
-      backend_gtype = _backend_gtype_override;
-      n_properties = _backend_property_names->len;
-      prop_names = (const char **) _backend_property_names->data;
-      prop_values = (GValue *) _backend_property_values->data;
-    }
-  else
-    {
-      calculate_compositor_configuration (&compositor_type,
-                                          &backend_gtype,
-                                          &n_properties,
-                                          &prop_names,
-                                          &prop_values);
-    }
+  calculate_compositor_configuration (&compositor_type,
+                                      &backend_gtype,
+                                      &n_properties,
+                                      &prop_names,
+                                      &prop_values);
 
 #ifdef HAVE_WAYLAND
   if (compositor_type == META_COMPOSITOR_TYPE_WAYLAND)
@@ -801,12 +730,6 @@ meta_init (void)
   for (i = 0; i < n_properties; i++)
     g_value_reset (&prop_values[i]);
 
-  if (_backend_property_names)
-    {
-      g_array_free (_backend_property_names, TRUE);
-      g_array_free (_backend_property_values, TRUE);
-    }
-
 #ifdef HAVE_NATIVE_BACKEND
   add_persistent_virtual_monitors ();
 #endif
@@ -976,23 +899,3 @@ meta_get_x11_display_policy (void)
 
   return META_X11_DISPLAY_POLICY_MANDATORY;
 }
-
-void
-meta_test_init (void)
-{
-#if defined(HAVE_WAYLAND)
-  g_autofree char *display_name = g_strdup ("mutter-test-display-XXXXXX");
-  int fd = g_mkstemp (display_name);
-
-  meta_override_compositor_configuration (META_COMPOSITOR_TYPE_WAYLAND,
-                                          META_TYPE_BACKEND_X11_NESTED,
-                                          NULL);
-  meta_wayland_override_display_name (display_name);
-  meta_xwayland_override_display_number (512 + rand() % 512);
-  meta_init ();
-
-  close (fd);
-#else
-  g_warning ("Tests require wayland support");
-#endif
-}
diff --git a/src/meta/main.h b/src/meta/main.h
index c1ba2ce2c0..fb32d23b43 100644
--- a/src/meta/main.h
+++ b/src/meta/main.h
@@ -72,9 +72,6 @@ void meta_exit (MetaExitCode code) G_GNUC_NORETURN;
 META_EXPORT
 void meta_quit (MetaExitCode code);
 
-META_EXPORT
-void            meta_test_init               (void);
-
 META_EXPORT
 void meta_start (void);
 


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