Accept closeEvent() for mainwindow when closing to tray

There's no difference between close() and hide() if WA_DeleteOnClose is not set, so if we're going to hide the window we might as well accept the event.
Ignoring the event may interrupt shutdowns since it signals that the application doesn't want to close the window, at least this happens on Plasma 5.11 when Clementine is not minimized to tray.
This commit is contained in:
Valeriy Malov 2018-03-13 21:19:14 +03:00 committed by John Maguire
parent 335bc89c97
commit 2d7894915d
1 changed files with 1 additions and 1 deletions

View File

@ -1408,7 +1408,7 @@ void MainWindow::closeEvent(QCloseEvent* event) {
bool keep_running = s.value("keeprunning", tray_icon_->IsVisible()).toBool();
if (keep_running && event->spontaneous()) {
event->ignore();
event->accept();
SetHiddenInTray(true);
} else {
QApplication::quit();