fix: try to fix macos close to tray issue

can not be sure .
though the code will have not side effect.
This commit is contained in:
yifang 2022-02-18 20:22:56 +08:00
parent 803ec13b98
commit cc9b64876f

View file

@ -1222,6 +1222,11 @@ void MainWindow::closeEvent( QCloseEvent * ev )
if( !cfg.preferences.searchInDock ) if( !cfg.preferences.searchInDock )
translateBox->setPopupEnabled( false ); translateBox->setPopupEnabled( false );
#ifdef Q_OS_MACOS
if (!event->spontaneous() || !isVisible()) {
return;
}
#endif
#ifdef HAVE_X11 #ifdef HAVE_X11
// Don't ignore the close event, because doing so cancels session logout if // 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. // the main window is visible when the user attempts to log out.