summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-12-08 22:09:15 +0100
committerStanislaw Halik <sthalik@misaki.pl>2014-12-08 22:09:15 +0100
commitd64c2414e771acdf1d976200dc2c683b852d4f39 (patch)
treec1deeb982389c4fc372e484a966f02c077e0e6b0
parentf22c5bfb6e1da213dba90d12d205fd136ac28245 (diff)
ensure tray exists before minimizing to it
Issue: #104
-rw-r--r--facetracknoir/ui.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/facetracknoir/ui.cpp b/facetracknoir/ui.cpp
index 06ff2d3c..9c6d0522 100644
--- a/facetracknoir/ui.cpp
+++ b/facetracknoir/ui.cpp
@@ -442,6 +442,10 @@ void MainWindow::restore_from_tray(QSystemTrayIcon::ActivationReason)
void MainWindow::changeEvent(QEvent* e)
{
if (s.tray_enabled && e->type() == QEvent::WindowStateChange && (windowState() & Qt::WindowMinimized))
+ {
+ if (!tray)
+ ensure_tray();
hide();
+ }
QMainWindow::changeEvent(e);
}