Exit when receiving OS Close Message when in tray

* Fixes #2692
* KeePassXC was ignoring OS close messages on shutdown or logoff when minimize to tray on close was enabled. This change causes a second close message (when KeePassXC is hidden to the tray) to actually exit the application.
This commit is contained in:
Jonathan White 2019-05-30 19:46:09 -04:00
parent 6f443ee9fc
commit a747886323

View File

@ -874,7 +874,9 @@ void MainWindow::closeEvent(QCloseEvent* event)
return;
}
if (config()->get("GUI/MinimizeOnClose").toBool() && !m_appExitCalled) {
// Don't ignore close event when the app is hidden to tray.
// This can occur when the OS issues close events on shutdown.
if (config()->get("GUI/MinimizeOnClose").toBool() && !isHidden() && !m_appExitCalled) {
event->ignore();
hideWindow();
return;