From 2edcffb40ee50160b44178dda85ae31f357ac678 Mon Sep 17 00:00:00 2001 From: Robert Love Date: Wed, 22 Mar 2006 21:17:07 +0000 Subject: [PATCH] 2006-03-22 Robert Love Bug fix by Timo Hoenig : * gnome/applet/applet-dbus.c: Let the applet reconnect to DBUS on disconnect. Otherwise, we have the daemon surviving DBUS restarts and the applet going AWOL. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1630 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- ChangeLog | 7 +++++++ gnome/applet/applet-dbus.c | 21 +++++++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6787b4c6c8..895b3e9e0c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-03-22 Robert Love + + Bug fix by Timo Hoenig : + * gnome/applet/applet-dbus.c: Let the applet reconnect to DBUS on + disconnect. Otherwise, we have the daemon surviving DBUS restarts + and the applet going AWOL. + 2006-03-22 Robert Love * src/dhcp-manager/nm-dhcp-manager.c: Create NM_DHCP_TIMEOUT diff --git a/gnome/applet/applet-dbus.c b/gnome/applet/applet-dbus.c index da5180b32f..4142805b9e 100644 --- a/gnome/applet/applet-dbus.c +++ b/gnome/applet/applet-dbus.c @@ -186,7 +186,13 @@ static DBusHandlerResult nma_dbus_filter (DBusConnection *connection, DBusMessag /* nm_info ("signal(): got signal op='%s' member='%s' interface='%s'", object_path, member, interface); */ - if (dbus_message_is_signal (message, DBUS_INTERFACE_DBUS, "NameOwnerChanged")) + if (dbus_message_is_signal (message, DBUS_INTERFACE_LOCAL, "Disconnected")) + { + dbus_connection_unref (applet->connection); + applet->connection = NULL; + applet->nm_running = FALSE; + } + else if (dbus_message_is_signal (message, DBUS_INTERFACE_DBUS, "NameOwnerChanged")) { char *service; char *old_owner; @@ -516,11 +522,14 @@ static gboolean nma_dbus_connection_watcher (gpointer user_data) if ((applet->connection = nma_dbus_init (applet))) { applet->nm_running = nma_dbus_nm_is_running (applet->connection); - nma_set_state (applet, NM_STATE_DISCONNECTED); - nma_dbus_update_nm_state (applet); - nma_dbus_update_devices (applet); - nma_dbus_update_dialup (applet); - nma_dbus_vpn_update_vpn_connections (applet); + if (applet->nm_running) + { + nma_set_state (applet, NM_STATE_DISCONNECTED); + nma_dbus_update_nm_state (applet); + nma_dbus_update_devices (applet); + nma_dbus_update_dialup (applet); + nma_dbus_vpn_update_vpn_connections (applet); + } } }