From b8c1829857082a72035cfe028750a0d69bca813f Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Sun, 27 Sep 2015 23:16:18 +0200 Subject: [PATCH] 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. --- src/gui/MainWindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 77c34f12c..7e8e702ba 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -20,6 +20,7 @@ #include #include +#include #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();