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; return s_system_valid;
} }
bool QtHost::IsFullscreenUIStarted()
{
return s_fullscreen_ui_started;
}
const QString& QtHost::GetCurrentGameTitle() const QString& QtHost::GetCurrentGameTitle()
{ {
return s_current_game_title; return s_current_game_title;
@ -1987,8 +1992,8 @@ bool MainWindow::shouldHideMouseCursor() const
bool MainWindow::shouldHideMainWindow() const bool MainWindow::shouldHideMainWindow() const
{ {
return Host::GetBoolSettingValue("Main", "HideMainWindowWhenRunning", false) || return Host::GetBoolSettingValue("Main", "HideMainWindowWhenRunning", false) || QtHost::CanRenderToMainWindow() ||
(QtHost::CanRenderToMainWindow() && isRenderingFullscreen()) || QtHost::InNoGUIMode(); QtHost::InNoGUIMode();
} }
void MainWindow::switchToGameListView() void MainWindow::switchToGameListView()
@ -2616,7 +2621,8 @@ bool MainWindow::requestShutdown(bool allow_confirm /* = true */, bool allow_sav
save_state = save_cb->isChecked(); save_state = save_cb->isChecked();
// Don't switch back to fullscreen when we're shutting down anyway. // 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, // 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?") "seconds for it to finish saving.\n\nDo you want to %1 anyway?")
.arg(action)) != QMessageBox::No); .arg(action)) != QMessageBox::No);
if (cancel_resume_on_accept) if (cancel_resume_on_accept && !QtHost::IsFullscreenUIStarted())
lock.cancelResume(); lock.cancelResume();
Host::RunOnCPUThread([result, callback = std::move(callback)]() { callback(result); }); Host::RunOnCPUThread([result, callback = std::move(callback)]() { callback(result); });

View File

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