diff --git a/src/vorta/tray_menu.py b/src/vorta/tray_menu.py index ca466d8d..cfab9a26 100644 --- a/src/vorta/tray_menu.py +++ b/src/vorta/tray_menu.py @@ -13,9 +13,10 @@ def __init__(self, parent: QApplication = None): menu = QMenu() # Workaround to get `activated` signal on Unity: https://stackoverflow.com/a/43683895/3983708 - menu.aboutToShow.connect(self.on_user_click) + menu.aboutToShow.connect(self.build_menu) self.setContextMenu(menu) + self.build_menu() self.activated.connect(self.on_activation) self.app.paletteChanged.connect(lambda p: self.set_tray_icon()) @@ -35,7 +36,7 @@ def on_activation(self, reason): ] and os.environ.get('XDG_CURRENT_DESKTOP'): self.app.toggle_main_window_visibility() - def on_user_click(self): + def build_menu(self): """Build system tray menu based on current state.""" menu = self.contextMenu()