[mutter] monitor-manager: Use connect_object to connect to settings signals



commit ef0f708404c9974273fe66a60471b2860f0741dc
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Fri Mar 19 15:39:35 2021 +0100

    monitor-manager: Use connect_object to connect to settings signals
    
    We were disconnecting from the wrong object, so instead of adjusting it
    we can simply use "new" utility functions instead.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1964>

 src/backends/meta-monitor-manager-private.h |  2 --
 src/backends/meta-monitor-manager.c         | 12 ++++--------
 2 files changed, 4 insertions(+), 10 deletions(-)
---
diff --git a/src/backends/meta-monitor-manager-private.h b/src/backends/meta-monitor-manager-private.h
index dd12ab0500..3282b373ac 100644
--- a/src/backends/meta-monitor-manager-private.h
+++ b/src/backends/meta-monitor-manager-private.h
@@ -148,8 +148,6 @@ struct _MetaMonitorManager
 
   GnomePnpIds *pnp_ids;
 
-  gulong experimental_features_changed_handler_id;
-
   MetaMonitorSwitchConfigType current_switch_config;
 };
 
diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c
index 934a685077..4cf4d90c5f 100644
--- a/src/backends/meta-monitor-manager.c
+++ b/src/backends/meta-monitor-manager.c
@@ -1055,11 +1055,10 @@ meta_monitor_manager_constructed (GObject *object)
 
   manager->display_config = meta_dbus_display_config_skeleton_new ();
 
-  manager->experimental_features_changed_handler_id =
-    g_signal_connect (settings,
-                      "experimental-features-changed",
-                      G_CALLBACK (experimental_features_changed),
-                      manager);
+  g_signal_connect_object (settings,
+                           "experimental-features-changed",
+                           G_CALLBACK (experimental_features_changed),
+                           manager, 0);
 
   monitor_manager_setup_dbus_config_handlers (manager);
 
@@ -1102,9 +1101,6 @@ meta_monitor_manager_finalize (GObject *object)
 
   g_warn_if_fail (!priv->virtual_monitors);
 
-  g_clear_signal_handler (&manager->experimental_features_changed_handler_id,
-                          manager->backend);
-
   G_OBJECT_CLASS (meta_monitor_manager_parent_class)->finalize (object);
 }
 


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