Refresh the apps on icon-theme-changed

This shouldn't be necessary. The icons change by themselves when the theme changes, ithout the need to refresh the list of apps.

That said, at login, we're observing what looks like a race condition, which sometimes results in category and sometimes apps icons not being displayed.

The possible cause for this is a late initialization of the icon theme, so this commit might fix it.

If after this commit, this issue is still visible, then this commit should be reverted.
This commit is contained in:
Clement Lefebvre 2016-05-21 18:33:00 +01:00
parent 3f1e04c577
commit bb36ce7151

View File

@ -282,6 +282,10 @@ class pluginclass( object ):
self.builder.get_object("searchButton").connect( "button-press-event", self.searchPopup )
self.icon_theme = Gtk.IconTheme.get_default();
self.icon_theme.connect("changed", self.on_icon_theme_changed)
def refresh_apt_cache(self):
if self.useAPT:
os.system("mkdir -p %s/.linuxmint/mintMenu/" % home)
@ -1546,6 +1550,10 @@ class pluginclass( object ):
#self.favoritesReorder( int(selection.data), widget.position )
self.favoritesReorder( self.drag_origin, widget.position )
def on_icon_theme_changed(self, theme):
print "on_icon_theme_changed"
self.menuChanged (0, 0)
def menuChanged( self, x, y ):
print ("menuChanged")
# wait 1s, to avoid building the menu multiple times concurrently