diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/application-service-appstore.c | 2 | ||||
-rw-r--r-- | src/indicator-application.c | 2 | ||||
-rw-r--r-- | src/libappindicator/app-indicator.c | 44 |
3 files changed, 38 insertions, 10 deletions
diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 70fab18..c784495 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -224,7 +224,7 @@ get_all_properties_cb (DBusGProxy * proxy, GHashTable * properties, GError * err app->icon = g_value_dup_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_ICON_NAME)); app->menu = g_value_dup_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_MENU)); if (g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_AICON_NAME) != NULL) { - app->aicon = g_value_dup_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_ICON_NAME)); + app->aicon = g_value_dup_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_AICON_NAME)); } gpointer icon_path_data = g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_ICON_PATH); diff --git a/src/indicator-application.c b/src/indicator-application.c index 8d9ae37..170e0d4 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -531,8 +531,10 @@ application_icon_changed (DBusGProxy * proxy, gint position, const gchar * iconn just use the name we were given. */ gchar * longname = g_strdup_printf("%s-%s", iconname, PANEL_ICON_SUFFIX); if (gtk_icon_theme_has_icon(gtk_icon_theme_get_default(), longname)) { + g_debug("Setting icon on %d to %s", position, longname); gtk_image_set_from_icon_name(app->entry.image, longname, GTK_ICON_SIZE_MENU); } else { + g_debug("Setting icon on %d to %s", position, iconname); gtk_image_set_from_icon_name(app->entry.image, iconname, GTK_ICON_SIZE_MENU); } g_free(longname); diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index 908684f..426ee8c 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -330,6 +330,7 @@ app_indicator_init (AppIndicator *self) g_error_free(error); return; } + dbus_g_connection_ref(priv->connection); dbus_g_connection_register_g_object(priv->connection, DEFAULT_ITEM_PATH, @@ -386,6 +387,11 @@ app_indicator_dispose (GObject *object) priv->watcher_proxy = NULL; } + if (priv->connection != NULL) { + dbus_g_connection_unref(priv->connection); + priv->connection = NULL; + } + G_OBJECT_CLASS (app_indicator_parent_class)->dispose (object); return; } @@ -684,6 +690,33 @@ dbus_owner_change (DBusGProxy * proxy, const gchar * name, const gchar * prev, c 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 + a new proxy as part of destroying an old one. This function being + on idle means that we'll just do it outside of the same stack where + the previous proxy is being destroyed. */ +static gboolean +setup_name_owner_proxy (gpointer data) +{ + g_return_val_if_fail(IS_APP_INDICATOR(data), FALSE); + AppIndicatorPrivate * priv = APP_INDICATOR(data)->priv; + + if (priv->dbus_proxy == NULL) { + priv->dbus_proxy = dbus_g_proxy_new_for_name(priv->connection, + DBUS_SERVICE_DBUS, + DBUS_PATH_DBUS, + DBUS_INTERFACE_DBUS); + dbus_g_proxy_add_signal(priv->dbus_proxy, "NameOwnerChanged", + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal(priv->dbus_proxy, "NameOwnerChanged", + G_CALLBACK(dbus_owner_change), data, NULL); + } + + return FALSE; +} + /* A function that will start the fallback timer if it's not already started. It sets up the DBus watcher to see if there is a change. Also, provides an override mode for cases @@ -701,15 +734,8 @@ start_fallback_timer (AppIndicator * self, gboolean disable_timeout) } if (priv->dbus_proxy == NULL) { - priv->dbus_proxy = dbus_g_proxy_new_for_name(priv->connection, - DBUS_SERVICE_DBUS, - DBUS_PATH_DBUS, - DBUS_INTERFACE_DBUS); - dbus_g_proxy_add_signal(priv->dbus_proxy, "NameOwnerChanged", - G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, - G_TYPE_INVALID); - dbus_g_proxy_connect_signal(priv->dbus_proxy, "NameOwnerChanged", - G_CALLBACK(dbus_owner_change), self, NULL); + /* NOTE: Read the comment on setup_name_owner_proxy */ + g_idle_add(setup_name_owner_proxy, self); } if (disable_timeout) { |