Skip to content

Instantly share code, notes, and snippets.

@Korvox
Last active Jul 21, 2020
Embed
What would you like to do?
diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp
index 14921028c..be8b13be7 100644
--- a/src/ui/mainwindow.cpp
+++ b/src/ui/mainwindow.cpp
@@ -1444,17 +1444,9 @@ void MainWindow::StopAfterCurrent() {
}
void MainWindow::closeEvent(QCloseEvent* event) {
- bool keep_running(false);
- if (tray_icon_)
- keep_running =
- settings_.value("keeprunning", tray_icon_->IsVisible()).toBool();
-
- if (keep_running && event->spontaneous()) {
- event->ignore();
- SetHiddenInTray(true);
- } else {
- Exit();
- }
+ if (!tray_icon_ || !tray_icon_->IsVisible())
+ Exit();
+ QMainWindow::closeEvent(event);
}
void MainWindow::SetHiddenInTray(bool hidden) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment