diff options
author | Aurelien Gateau <aurelien.gateau@canonical.com> | 2011-08-02 15:37:50 +0200 |
---|---|---|
committer | Aurelien Gateau <aurelien.gateau@canonical.com> | 2011-08-02 15:37:50 +0200 |
commit | 1790510cc8db70c5adb3c2b3f25382d39db1a99f (patch) | |
tree | 4f648e6cbe4ce3df2c12d05ac16543dd281a6070 /libindicator | |
parent | a51845f9aaed2a951eab8afba1aad685b3361f37 (diff) | |
download | libayatana-indicator-1790510cc8db70c5adb3c2b3f25382d39db1a99f.tar.gz libayatana-indicator-1790510cc8db70c5adb3c2b3f25382d39db1a99f.tar.bz2 libayatana-indicator-1790510cc8db70c5adb3c2b3f25382d39db1a99f.zip |
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.
Diffstat (limited to 'libindicator')
-rw-r--r-- | libindicator/indicator-image-helper.c | 5 |
1 files changed, 5 insertions, 0 deletions
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 @@ -44,6 +44,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 )); if (names) { |