Merge lp:~agateau/libindicator/rescan-icon-theme into lp:libindicator/0.4

Proposed by Aurélien Gâteau
Status: Merged
Merged at revision: 430
Proposed branch: lp:~agateau/libindicator/rescan-icon-theme
Merge into: lp:libindicator/0.4
Diff against target: 15 lines (+5/-0)
1 file modified
libindicator/indicator-image-helper.c (+5/-0)
To merge this branch: bzr merge lp:~agateau/libindicator/rescan-icon-theme
Reviewer Review Type Date Requested Status
Ted Gould Pending
Review via email: mp+70162@code.launchpad.net

Description of the change

Rescan the icon theme if the wanted icon cannot be found.

You can reproduce the problem with sni-qt test program:

bzr branch lp:sni-qt
cd sni-qt
mkdir build
cd build
cmake ..
make
tests/manual/systray

Then change the icon with the combobox less than 5 seconds after startup.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libindicator/indicator-image-helper.c'
2--- libindicator/indicator-image-helper.c 2010-08-16 14:14:49 +0000
3+++ libindicator/indicator-image-helper.c 2011-08-02 13:43:27 +0000
4@@ -44,6 +44,11 @@
5 /* Look through the themes for that icon */
6 icon_info = gtk_icon_theme_lookup_by_gicon(default_theme, icon_names, icon_size, 0);
7 if (icon_info == NULL) {
8+ /* Maybe the icon was just added to the theme, see if a rescan helps */
9+ gtk_icon_theme_rescan_if_needed(default_theme);
10+ icon_info = gtk_icon_theme_lookup_by_gicon(default_theme, icon_names, icon_size, 0);
11+ }
12+ if (icon_info == NULL) {
13 /* Try using the second item in the names, which should be the original filename supplied */
14 const gchar * const * names = g_themed_icon_get_names(G_THEMED_ICON( icon_names ));
15 if (names) {

Subscribers

People subscribed via source and target branches