Check if the tray icon is visible before minimizing to it.

This commit is contained in:
Felix Geyer committed 2015-11-01 23:32:37 +01:00
1 parent 9e1ea264e2
commit 7839280cb3
1 file changed
+2 -1
+2 -1
View File
@@ -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()));