From a50c978ce3e1511ff286f11a8bb53f854a09d5b3 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Sun, 25 Oct 2020 19:59:27 +0100 Subject: [PATCH] Fix cancelling logout when window is maxmimized Fixes #565 --- src/core/mainwindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/mainwindow.cpp b/src/core/mainwindow.cpp index 14004748..8bc9e9e6 100644 --- a/src/core/mainwindow.cpp +++ b/src/core/mainwindow.cpp @@ -1531,18 +1531,20 @@ void MainWindow::showEvent(QShowEvent *e) { void MainWindow::closeEvent(QCloseEvent *e) { if (!hidden_ && keep_running_ && e->spontaneous() && QSystemTrayIcon::isSystemTrayAvailable()) { - e->ignore(); SetHiddenInTray(true); } else { Exit(); } + QMainWindow::closeEvent(e); + } void MainWindow::SetHiddenInTray(const bool hidden) { hidden_ = hidden; + settings_.setValue("hidden", hidden_); // Some window managers don't remember maximized state between calls to hide() and show(), so we have to remember it ourself. if (hidden) {