From ff65f9f759bad5b929e1057a3ca482ef0107649c Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 30 Sep 2011 18:04:27 +0200 Subject: src/app-indicator.c: do not add the same icon_theme_path again, gtk3 apparently does not check this --- src/app-indicator.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/app-indicator.c') diff --git a/src/app-indicator.c b/src/app-indicator.c index 13c7ce4..285abd6 100644 --- a/src/app-indicator.c +++ b/src/app-indicator.c @@ -1523,10 +1523,25 @@ status_icon_changes (AppIndicator * self, gpointer data) GtkStatusIcon * icon = GTK_STATUS_ICON(data); gchar *longname = NULL; + /* add the icon_theme_path once if needed */ GtkIconTheme *icon_theme = gtk_icon_theme_get_default(); if (self->priv->icon_theme_path != NULL) { - gtk_icon_theme_append_search_path(icon_theme, self->priv->icon_theme_path); + gchar **path; + gint n_elements, i; + gboolean found=FALSE; + gtk_icon_theme_get_search_path(icon_theme, &path, &n_elements); + for (i=0; i< n_elements || path[i] == NULL; i++) + { + if(g_strcmp0(path[i], self->priv->icon_theme_path) == 0) + { + found=TRUE; + break; + } + } + if(!found) + gtk_icon_theme_append_search_path(icon_theme, self->priv->icon_theme_path); + g_strfreev (path); } switch (app_indicator_get_status(self)) { -- cgit v1.2.3