aboutsummaryrefslogtreecommitdiff
path: root/src/qt/macdockiconhandler.mm
diff options
context:
space:
mode:
authorJonas Schnelli <jonasschnelli@Jonass-MacBook-Pro.local>2013-04-14 22:11:55 +0200
committerJonas Schnelli <jonas.schnelli@include7.ch>2013-04-15 12:02:01 +0200
commit4d17a1b0c29e8fd8510c75db1efb203b9b4f9eb0 (patch)
tree927cce25f832d04b6ff229d91c4da5bed63437c9 /src/qt/macdockiconhandler.mm
parent463a58ae75c817a1f81d439167d1ec9229263312 (diff)
fix: GUI Disappearing #1522 (Mac OSX)
- this solution works stable on mac and ensures that the window get's reopened when the user clicks the dock icon . - tested on 10.8 with Qt4.8.4 and Qt5.0.1 Signed-off-by: Jonas Schnelli <jonas.schnelli@include7.ch>
Diffstat (limited to 'src/qt/macdockiconhandler.mm')
-rw-r--r--src/qt/macdockiconhandler.mm11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/qt/macdockiconhandler.mm b/src/qt/macdockiconhandler.mm
index ea868401c0..b6ea8e1d03 100644
--- a/src/qt/macdockiconhandler.mm
+++ b/src/qt/macdockiconhandler.mm
@@ -37,8 +37,9 @@ extern void qt_mac_set_dock_menu(QMenu*);
Q_UNUSED(event)
Q_UNUSED(replyEvent)
- if (dockIconHandler)
+ if (dockIconHandler) {
dockIconHandler->handleDockIconClickEvent();
+ }
}
@end
@@ -54,10 +55,15 @@ MacDockIconHandler::MacDockIconHandler() : QObject()
[pool release];
}
+void MacDockIconHandler::setMainWindow(QMainWindow *window) {
+ this->mainWindow = window;
+}
+
MacDockIconHandler::~MacDockIconHandler()
{
[this->m_dockIconClickEventHandler release];
delete this->m_dummyWidget;
+ this->setMainWindow(NULL);
}
QMenu *MacDockIconHandler::dockMenu()
@@ -94,5 +100,8 @@ MacDockIconHandler *MacDockIconHandler::instance()
void MacDockIconHandler::handleDockIconClickEvent()
{
+ this->mainWindow->activateWindow();
+ this->mainWindow->show();
+
emit this->dockIconClicked();
}