Browse Source

Systray: Force window raise when being re-shown

tags/v0.9.0
falkTX 13 years ago
parent
commit
57275133e7
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      src/systray.py

+ 8
- 1
src/systray.py View File

@@ -18,7 +18,7 @@


# Imports (Global) # Imports (Global)
import os, sys import os, sys
from PyQt4.QtCore import SIGNAL
from PyQt4.QtCore import QTimer, SIGNAL
from PyQt4.QtGui import QAction, QIcon, QMenu, QSystemTrayIcon from PyQt4.QtGui import QAction, QIcon, QMenu, QSystemTrayIcon


try: try:
@@ -618,14 +618,21 @@ class GlobalSysTray(object):
self._parent.hide() self._parent.hide()
else: else:
self.setActionText("show", self._parent.tr("Minimize")) self.setActionText("show", self._parent.tr("Minimize"))

if self._parent.isMaximized(): if self._parent.isMaximized():
self._parent.showMaximized() self._parent.showMaximized()
else: else:
self._parent.showNormal() self._parent.showNormal()


QTimer.singleShot(100, self.__raiseWindow)

def __quitCall(self): def __quitCall(self):
self._parent.close() self._parent.close()


def __raiseWindow(self):
self._parent.activateWindow()
self._parent.raise_()

#--------------- main ------------------ #--------------- main ------------------
if __name__ == '__main__': if __name__ == '__main__':
from PyQt4.QtGui import QApplication, QDialog, QMessageBox from PyQt4.QtGui import QApplication, QDialog, QMessageBox


Loading…
Cancel
Save