From 7839280cb386cc03a261c1ee2b465c04701fe934 Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Sun, 1 Nov 2015 23:27:57 +0100 Subject: [PATCH] Check if the tray icon is visible before minimizing to it. --- src/gui/MainWindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 9a06ac893..cf26f1818 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -446,7 +446,8 @@ void MainWindow::closeEvent(QCloseEvent* event) void MainWindow::changeEvent(QEvent *event) { if ((event->type() == QEvent::WindowStateChange) && isMinimized() - && isTrayIconEnabled() && config()->get("GUI/MinimizeToTray").toBool()) + && isTrayIconEnabled() && m_trayIcon && m_trayIcon->isVisible() + && config()->get("GUI/MinimizeToTray").toBool()) { event->ignore(); QTimer::singleShot(0, this, SLOT(hide()));