Qt: Fix -nogui/-batch closing

This commit is contained in:
Stenzek 2023-01-28 12:48:39 +10:00 committed by refractionpcsx2
parent 84d7fe550b
commit 1b40e4aaca
1 changed files with 2 additions and 1 deletions

View File

@ -1241,7 +1241,8 @@ void Host::RequestVMShutdown(bool allow_confirm, bool allow_save_state, bool def
if (!VMManager::HasValidVM())
return;
if (allow_confirm)
// MainWindow handles close-on-exit for batch mode.
if (allow_confirm || QtHost::InBatchMode())
{
// Run it on the host thread, that way we get the confirm prompt (if enabled).
QMetaObject::invokeMethod(g_main_window, "requestShutdown", Qt::QueuedConnection, Q_ARG(bool, allow_confirm),