diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 686906e57..edbcd9161 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -558,7 +558,7 @@ void MainWindow::StopAfterCurrent() { * Exit if the tray icon is not visible, otherwise ignore and set hidden in tray. */ void MainWindow::closeEvent(QCloseEvent* event) { - if (tray_icon_->isVisible()) { + if (tray_icon_->isVisible() && event->spontaneous()) { event->ignore(); SetHiddenInTray(true); } else {