From 1790510cc8db70c5adb3c2b3f25382d39db1a99f Mon Sep 17 00:00:00 2001 From: Aurelien Gateau Date: Tue, 2 Aug 2011 15:37:50 +0200 Subject: Ask GTK to rescan the icon theme if the wanted icon cannot be found. This is necessary at least with sni-qt, which generates icon on the fly in a custom theme dir. --- libindicator/indicator-image-helper.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libindicator/indicator-image-helper.c b/libindicator/indicator-image-helper.c index b404b8f..23b08d0 100644 --- a/libindicator/indicator-image-helper.c +++ b/libindicator/indicator-image-helper.c @@ -43,6 +43,11 @@ refresh_image (GtkImage * image) /* Look through the themes for that icon */ icon_info = gtk_icon_theme_lookup_by_gicon(default_theme, icon_names, icon_size, 0); + if (icon_info == NULL) { + /* Maybe the icon was just added to the theme, see if a rescan helps */ + gtk_icon_theme_rescan_if_needed(default_theme); + icon_info = gtk_icon_theme_lookup_by_gicon(default_theme, icon_names, icon_size, 0); + } if (icon_info == NULL) { /* Try using the second item in the names, which should be the original filename supplied */ const gchar * const * names = g_themed_icon_get_names(G_THEMED_ICON( icon_names )); -- cgit v1.2.3