Improve tray icon behavior on OS X.

Previously the main window had issues on restore:
- was sometimes hidden again.
- window was unresponsive, all actions disabled.
This commit is contained in:
Felix Geyer 2015-09-27 23:16:18 +02:00
parent 4f2d56a55f
commit b8c1829857

View File

@ -20,6 +20,7 @@
#include <QCloseEvent>
#include <QShortcut>
#include <QTimer>
#include "autotype/AutoType.h"
#include "core/Config.h"
@ -448,7 +449,7 @@ void MainWindow::changeEvent(QEvent *event)
&& isTrayIconEnabled() && config()->get("GUI/MinimizeToTray").toBool())
{
event->ignore();
hide();
QTimer::singleShot(0, this, SLOT(hide()));
}
else {
QMainWindow::changeEvent(event);
@ -578,6 +579,7 @@ void MainWindow::toggleWindow()
hide();
}
else {
setWindowState(windowState() & ~Qt::WindowMinimized);
show();
raise();
activateWindow();