From bb36ce715175db4bd259ac90d6f33d7b8b1cf58c Mon Sep 17 00:00:00 2001 From: Clement Lefebvre Date: Sat, 21 May 2016 18:33:00 +0100 Subject: [PATCH] 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. --- usr/lib/linuxmint/mintMenu/plugins/applications.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/usr/lib/linuxmint/mintMenu/plugins/applications.py b/usr/lib/linuxmint/mintMenu/plugins/applications.py index 020d828..2a927ef 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/applications.py +++ b/usr/lib/linuxmint/mintMenu/plugins/applications.py @@ -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