From cc9b64876fb8a481ae0908cc97e5f2cfcba69e69 Mon Sep 17 00:00:00 2001 From: yifang Date: Fri, 18 Feb 2022 20:22:56 +0800 Subject: [PATCH] fix: try to fix macos close to tray issue can not be sure . though the code will have not side effect. --- mainwindow.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mainwindow.cc b/mainwindow.cc index 42d00b3a..ecea5e33 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -1222,6 +1222,11 @@ void MainWindow::closeEvent( QCloseEvent * ev ) if( !cfg.preferences.searchInDock ) translateBox->setPopupEnabled( false ); +#ifdef Q_OS_MACOS + if (!event->spontaneous() || !isVisible()) { + return; + } +#endif #ifdef HAVE_X11 // Don't ignore the close event, because doing so cancels session logout if // the main window is visible when the user attempts to log out.