From 642c715f496edd0824fb146fc3694c9b320787ba Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sat, 24 Nov 2018 04:16:51 +0100 Subject: [PATCH] tray menu: work around bug, fixes #48 --- src/vorta/tray_menu.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/vorta/tray_menu.py b/src/vorta/tray_menu.py index bc2bb3ce..1e89c452 100644 --- a/src/vorta/tray_menu.py +++ b/src/vorta/tray_menu.py @@ -30,17 +30,15 @@ def __init__(self, parent=None): exit_action.triggered.connect(self.app.quit) self.on_user_click() - self.activated.connect(self.on_user_click) + # https://stackoverflow.com/questions/43657890/pyqt5-qsystemtrayicon-activated-signal-not-working + menu.aboutToShow.connect(self.on_user_click) self.setContextMenu(menu) self.setVisible(True) self.show() - def on_user_click(self, reason=0): + def on_user_click(self): """Adjust labels to reflect current status.""" - # BUG on ubuntu 18.04 (standard edition with gnome): - # a single LMB click on the tray icon does not fire the "activated" signal (documented reason 3). - # working: double LMB click (reason reported 3, should be 2), MMB click (reason 4) if BorgThread.is_running(): self.status.setText('Backup in Progress') self.profile_menu.setEnabled(False)