[gdm/gnome-3-8] display: actually set slave_name_id and unwatch bus name in unmanage



commit 18097e4fca851cceab4ca36a373d31b3808d7f1a
Author: Jean-Benoit MARTIN <jean-benoit martin eurogiciel fr>
Date:   Tue Apr 23 11:54:48 2013 +0200

    display: actually set slave_name_id and unwatch bus name in unmanage
    
    slave_name_id is supposed to track the bus name watch of the slave, but
    it was never getting set.
    
    This commit sets it, and makes sure the watch is removed in unmanage.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=698370

 daemon/gdm-display.c |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)
---
diff --git a/daemon/gdm-display.c b/daemon/gdm-display.c
index 5e26b52..b1adae8 100644
--- a/daemon/gdm-display.c
+++ b/daemon/gdm-display.c
@@ -301,13 +301,13 @@ gdm_display_real_set_slave_bus_name (GdmDisplay *display,
                 g_bus_unwatch_name (display->priv->slave_name_id);
         }
 
-        g_bus_watch_name_on_connection (display->priv->connection,
-                                        name,
-                                        G_BUS_NAME_WATCHER_FLAGS_NONE,
-                                        NULL, /* name appeared */
-                                        on_name_vanished,
-                                        g_object_ref (display),
-                                        NULL);
+        display->priv->slave_name_id = g_bus_watch_name_on_connection (display->priv->connection,
+                                                                       name,
+                                                                       G_BUS_NAME_WATCHER_FLAGS_NONE,
+                                                                       NULL, /* name appeared */
+                                                                       on_name_vanished,
+                                                                       g_object_ref (display),
+                                                                       NULL);
 
         g_clear_object (&display->priv->slave_bus_proxy);
         display->priv->slave_bus_proxy = GDM_DBUS_SLAVE (gdm_dbus_slave_proxy_new_sync 
(display->priv->connection,
@@ -774,6 +774,11 @@ gdm_display_real_unmanage (GdmDisplay *display)
                 _gdm_display_set_status (display, GDM_DISPLAY_UNMANAGED);
         }
 
+        if (display->priv->slave_name_id > 0) {
+                g_bus_unwatch_name (display->priv->slave_name_id);
+                display->priv->slave_name_id = 0;
+        }
+
         return TRUE;
 }
 


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