shell/app-system: Monitor for icon theme changes

Whenever an app is installed, the usual routine is
to run 'gtk-update-icon-cache' after installing all
of the app's files.

The side effect of that is that the .desktop file of
the application is installed before the icon theme
is updated. By the time GAppInfoMonitor emits the
'changed' signal, the icon theme is not yet updated,
leading to StIcon use the fallback icon.

Under some circumstances (e.g. on very slow spinning
disks) the app icon is never actually loaded, and we
see the fallback icon forever.

Monitor the icon theme for changes when an app is
installed. Try as many as 6 times before giving up
on detecting an icon theme update.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/661
This commit is contained in:
Georges Basile Stavracas Neto
2019-08-01 20:58:20 -03:00
committed by Florian Müllner
parent dd9a452594
commit c0047cd11d
3 changed files with 64 additions and 0 deletions

View File

@@ -1567,3 +1567,11 @@ st_texture_cache_get_default (void)
instance = g_object_new (ST_TYPE_TEXTURE_CACHE, NULL);
return instance;
}
gboolean
st_texture_cache_rescan_icon_theme (StTextureCache *cache)
{
StTextureCachePrivate *priv = cache->priv;
return gtk_icon_theme_rescan_if_needed (priv->icon_theme);
}