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>
This commit is contained in:
committed by
Jonas Schnelli
parent
463a58ae75
commit
4d17a1b0c2
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user