From 3758df51a8e1f7e5b7585a0a62ad07400d1f55fd Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 19 Oct 2010 18:47:22 -0500 Subject: Adding a check for the name to ensure we didn't miss it --- src/app-indicator.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/app-indicator.c b/src/app-indicator.c index 6511589..44b1050 100644 --- a/src/app-indicator.c +++ b/src/app-indicator.c @@ -32,6 +32,8 @@ License version 3 and version 2.1 along with this program. If not, see #endif #include +#include + #include #include @@ -1052,6 +1054,17 @@ dbus_owner_change (DBusGProxy * proxy, const gchar * name, const gchar * prev, c return; } +/* Checking to see if someone already has the name we're looking for */ +static void +check_owner_cb (DBusGProxy *proxy, gboolean exists, GError *error, gpointer userdata) +{ + if (exists) { + dbus_owner_change(proxy, NOTIFICATION_WATCHER_DBUS_ADDR, NULL, "Non NULL", userdata); + } + + return; +} + /* This is an idle function to create the proxy. This is mostly because start_fallback_timer can get called in the distruction of a proxy and thus the proxy manager gets confused when creating @@ -1074,6 +1087,11 @@ setup_name_owner_proxy (gpointer data) G_TYPE_INVALID); dbus_g_proxy_connect_signal(priv->dbus_proxy, "NameOwnerChanged", G_CALLBACK(dbus_owner_change), data, NULL); + + /* Check to see if anyone has the name we're looking for + just incase we missed it changing. */ + + org_freedesktop_DBus_name_has_owner_async(priv->dbus_proxy, NOTIFICATION_WATCHER_DBUS_ADDR, check_owner_cb, data); } return FALSE; -- cgit v1.2.3