Skip to content

Instantly share code, notes, and snippets.

@Korvox
Last active July 21, 2020 06:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Korvox/c8db324ebf25b4508b80c4d5f52e15a0 to your computer and use it in GitHub Desktop.
Save Korvox/c8db324ebf25b4508b80c4d5f52e15a0 to your computer and use it in GitHub Desktop.
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