From 252701451d057b215524ab0c1c6eaab0cbcb4050 Mon Sep 17 00:00:00 2001 From: Martin Zibricky Date: Thu, 30 Jan 2014 08:16:36 +0100 Subject: [PATCH] Fix bug #1247661 by restoring the main window when it was previously minimized and user switch to OpenLP from another app. --- openlp/core/__init__.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/openlp/core/__init__.py b/openlp/core/__init__.py index a6eb7721f..2aa47ff77 100644 --- a/openlp/core/__init__.py +++ b/openlp/core/__init__.py @@ -220,8 +220,15 @@ class OpenLP(QtGui.QApplication): log.debug(u'Got open file event for %s!', file_name) self.args.insert(0, unicode(file_name)) return True - else: - return QtGui.QApplication.event(self, event) + # Mac OS X should restore app window when user clicked on the OpenLP icon + # in the Dock bar. However, OpenLP constists of multiple windows and this + # does not work. This workaround fixes that. + # The main OpenLP window is restored when it was previously minimized. + elif event.type() == QtCore.QEvent.ApplicationActivate: + if sys.platform.startswith('darwin') and self.mainWindow.isMinimized(): + self.mainWindow.showNormal() + return True + return QtGui.QApplication.event(self, event) def set_up_logging(log_path):