summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-10-10 03:59:01 +0900
committerkali <kali@leap.se>2012-10-10 03:59:01 +0900
commitf043f9087232a416bf9fa7dbb0b8f9b6f4e0a04e (patch)
tree6e65fdb8a0c1bf37926fbb159016026f31203d4d /src
parent9a0b07a12bc171a776a329d1f85e32be37c06254 (diff)
fix for left-click on systray
Closes #310
Diffstat (limited to 'src')
-rw-r--r--src/leap/app.py2
-rw-r--r--src/leap/baseapp/systray.py14
2 files changed, 11 insertions, 5 deletions
diff --git a/src/leap/app.py b/src/leap/app.py
index 341f6a6e..a1251ca8 100644
--- a/src/leap/app.py
+++ b/src/leap/app.py
@@ -36,7 +36,7 @@ def main():
console.setFormatter(formatter)
logger.addHandler(console)
- logger.debug(opts)
+ #logger.debug(opts)
logger.info('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~')
logger.info('LEAP client version %s', VERSION)
logger.info('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~')
diff --git a/src/leap/baseapp/systray.py b/src/leap/baseapp/systray.py
index d5d44f61..cc5d89df 100644
--- a/src/leap/baseapp/systray.py
+++ b/src/leap/baseapp/systray.py
@@ -100,6 +100,10 @@ class StatusAwareTrayIconMixin(object):
self.setIcon('disconnected')
self.trayIcon.setContextMenu(self.trayIconMenu)
+ #self.trayIconMenu.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
+ #self.trayIconMenu.customContextMenuRequested.connect(
+ #self.on_context_menu)
+
def bad(self):
logger.error('this should not be called')
@@ -178,12 +182,14 @@ class StatusAwareTrayIconMixin(object):
handles left click, left double click
showing the trayicon menu
"""
- #XXX there's a bug here!
- #menu shows on (0,0) corner first time,
- #until double clicked at least once.
if reason in (QtGui.QSystemTrayIcon.Trigger,
QtGui.QSystemTrayIcon.DoubleClick):
- self.trayIconMenu.show()
+ context_menu = self.trayIcon.contextMenu()
+ # for some reason, context_menu.show()
+ # is failing in a way beyond my understanding.
+ # (not working the first time it's clicked).
+ # this works however.
+ context_menu.exec_(self.trayIcon.geometry().center())
@QtCore.pyqtSlot()
def onTimerTick(self):