Qt: Avoid stuck in temporary render-to-separate mode

This commit is contained in:
Stenzek 2025-03-08 15:22:07 +10:00
parent 9f0bbccd50
commit e25f287d60
No known key found for this signature in database
3 changed files with 13 additions and 4 deletions

View File

@ -121,6 +121,11 @@ bool QtHost::IsSystemValid()
return s_system_valid;
}
bool QtHost::IsFullscreenUIStarted()
{
return s_fullscreen_ui_started;
}
const QString& QtHost::GetCurrentGameTitle()
{
return s_current_game_title;
@ -1987,8 +1992,8 @@ bool MainWindow::shouldHideMouseCursor() const
bool MainWindow::shouldHideMainWindow() const
{
return Host::GetBoolSettingValue("Main", "HideMainWindowWhenRunning", false) ||
(QtHost::CanRenderToMainWindow() && isRenderingFullscreen()) || QtHost::InNoGUIMode();
return Host::GetBoolSettingValue("Main", "HideMainWindowWhenRunning", false) || QtHost::CanRenderToMainWindow() ||
QtHost::InNoGUIMode();
}
void MainWindow::switchToGameListView()
@ -2616,7 +2621,8 @@ bool MainWindow::requestShutdown(bool allow_confirm /* = true */, bool allow_sav
save_state = save_cb->isChecked();
// Don't switch back to fullscreen when we're shutting down anyway.
lock.cancelResume();
if (!QtHost::IsFullscreenUIStarted())
lock.cancelResume();
}
// This is a little bit annoying. Qt will close everything down if we don't have at least one window visible,

View File

@ -1166,7 +1166,7 @@ void EmuThread::confirmActionIfMemoryCardBusy(const QString& action, bool cancel
"seconds for it to finish saving.\n\nDo you want to %1 anyway?")
.arg(action)) != QMessageBox::No);
if (cancel_resume_on_accept)
if (cancel_resume_on_accept && !QtHost::IsFullscreenUIStarted())
lock.cancelResume();
Host::RunOnCPUThread([result, callback = std::move(callback)]() { callback(result); });

View File

@ -382,6 +382,9 @@ bool ShouldShowDebugOptions();
bool IsSystemValid();
bool IsSystemPaused();
/// Returns true if fullscreen UI is requested.
bool IsFullscreenUIStarted();
/// Returns true if any lock is in place.
bool IsSystemLocked();