From 7dde0271ee896b46c12e9f4aab39f5df2a444643 Mon Sep 17 00:00:00 2001 From: Clement Lefebvre Date: Fri, 28 Apr 2017 16:26:39 +0100 Subject: [PATCH] Fix race condition with dconf on session start gsettings is known to randomly spit changes signal by mistake at session start. Only start listening to these after the menu elements are created. --- usr/lib/linuxmint/mintMenu/mintMenu.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/mintMenu.py b/usr/lib/linuxmint/mintMenu/mintMenu.py index 70cd375..79275a2 100755 --- a/usr/lib/linuxmint/mintMenu/mintMenu.py +++ b/usr/lib/linuxmint/mintMenu/mintMenu.py @@ -462,7 +462,14 @@ class MenuWin( object ): self.applet = applet self.detect_desktop_environment() self.settings = Gio.Settings.new("com.linuxmint.mintmenu") - self.keybinder = keybinding.GlobalKeyBinding() + self.keybinder = keybinding.GlobalKeyBinding() + self.loadSettings() + + self.createPanelButton() + + self.mate_settings = Gio.Settings.new("org.mate.interface") + self.mate_settings.connect( "changed::gtk-theme", self.changeTheme ) + self.settings.connect( "changed::applet-text", self.reloadSettings ) self.settings.connect( "changed::theme-name", self.changeTheme ) self.settings.connect( "changed::hot-key", self.reloadSettings ) @@ -470,12 +477,6 @@ class MenuWin( object ): self.settings.connect( "changed::hide-applet-icon", self.reloadSettings ) self.settings.connect( "changed::applet-icon-size", self.reloadSettings ) self.settings.connect( "changed::hot-key", self.hotkeyChanged ) - self.loadSettings() - - self.mate_settings = Gio.Settings.new("org.mate.interface") - self.mate_settings.connect( "changed::gtk-theme", self.changeTheme ) - - self.createPanelButton() self.applet.set_flags( MatePanelApplet.AppletFlags.EXPAND_MINOR ) self.applet.connect( "button-press-event", self.showMenu )