[mutter] stage-impl: Move properties from the stage window here



commit c0fb52cfe67bca697ed44ae9287809e3cee22e67
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Fri Sep 17 17:31:03 2021 +0200

    stage-impl: Move properties from the stage window here
    
    The stage window is an interface, that added properties, that were only
    then actually managed by MetaStageImpl. Shuffle things slightly, and let
    the MetaStageImpl object deal with these things itself.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2014>

 clutter/clutter/clutter-stage-window.c | 19 -------------------
 src/backends/meta-stage-impl.c         | 25 ++++++++++++++++++++++---
 2 files changed, 22 insertions(+), 22 deletions(-)
---
diff --git a/clutter/clutter/clutter-stage-window.c b/clutter/clutter/clutter-stage-window.c
index 9052a8c4bf..40c45e2fb1 100644
--- a/clutter/clutter/clutter-stage-window.c
+++ b/clutter/clutter/clutter-stage-window.c
@@ -20,25 +20,6 @@ G_DEFINE_INTERFACE (ClutterStageWindow, clutter_stage_window, G_TYPE_OBJECT);
 static void
 clutter_stage_window_default_init (ClutterStageWindowInterface *iface)
 {
-  GParamSpec *pspec;
-
-  pspec = g_param_spec_object ("backend",
-                               "Backend",
-                               "Back pointer to the Backend instance",
-                               CLUTTER_TYPE_BACKEND,
-                               G_PARAM_WRITABLE |
-                               G_PARAM_CONSTRUCT_ONLY |
-                               G_PARAM_STATIC_STRINGS);
-  g_object_interface_install_property (iface, pspec);
-
-  pspec = g_param_spec_object ("wrapper",
-                               "Wrapper",
-                               "Back pointer to the Stage actor",
-                               CLUTTER_TYPE_STAGE,
-                               G_PARAM_WRITABLE |
-                               G_PARAM_CONSTRUCT_ONLY |
-                               G_PARAM_STATIC_STRINGS);
-  g_object_interface_install_property (iface, pspec);
 }
 
 /**
diff --git a/src/backends/meta-stage-impl.c b/src/backends/meta-stage-impl.c
index 2990c89779..4ff30360c2 100644
--- a/src/backends/meta-stage-impl.c
+++ b/src/backends/meta-stage-impl.c
@@ -57,11 +57,15 @@ G_DEFINE_TYPE_WITH_CODE (MetaStageImpl,
 enum
 {
   PROP_0,
+
   PROP_WRAPPER,
   PROP_BACKEND,
-  PROP_LAST
+
+  N_PROPS
 };
 
+static GParamSpec *obj_props[N_PROPS];
+
 static void
 meta_stage_impl_unrealize (ClutterStageWindow *stage_window)
 {
@@ -790,8 +794,23 @@ meta_stage_impl_class_init (MetaStageImplClass *klass)
 
   gobject_class->set_property = meta_stage_impl_set_property;
 
-  g_object_class_override_property (gobject_class, PROP_WRAPPER, "wrapper");
-  g_object_class_override_property (gobject_class, PROP_BACKEND, "backend");
+  obj_props[PROP_WRAPPER] =
+    g_param_spec_object ("wrapper",
+                         "Wrapper",
+                         "Back pointer to the Stage actor",
+                         CLUTTER_TYPE_STAGE,
+                         G_PARAM_WRITABLE |
+                         G_PARAM_CONSTRUCT_ONLY |
+                         G_PARAM_STATIC_STRINGS);
+  obj_props[PROP_BACKEND] =
+    g_param_spec_object ("backend",
+                         "ClutterBackend",
+                         "ClutterBackend",
+                         CLUTTER_TYPE_BACKEND,
+                         G_PARAM_WRITABLE |
+                         G_PARAM_CONSTRUCT_ONLY |
+                         G_PARAM_STATIC_STRINGS);
+  g_object_class_install_properties (gobject_class, N_PROPS, obj_props);
 }
 
 static void


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