aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-09-30 18:04:27 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2011-09-30 18:04:27 +0200
commitff65f9f759bad5b929e1057a3ca482ef0107649c (patch)
tree5c350b15cd82ff6fec2f6b1f9d45807d5a2498f2 /src
parent5819385d28106fd7f511fc4e8eb4960b46a5fc37 (diff)
downloadlibayatana-appindicator-ff65f9f759bad5b929e1057a3ca482ef0107649c.tar.gz
libayatana-appindicator-ff65f9f759bad5b929e1057a3ca482ef0107649c.tar.bz2
libayatana-appindicator-ff65f9f759bad5b929e1057a3ca482ef0107649c.zip
src/app-indicator.c: do not add the same icon_theme_path again, gtk3 apparently does not check this
Diffstat (limited to 'src')
-rw-r--r--src/app-indicator.c17
1 files changed, 16 insertions, 1 deletions
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)) {