Skip to content

Commit e25f287

Browse files
committed
Qt: Avoid stuck in temporary render-to-separate mode
1 parent 9f0bbcc commit e25f287

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

‎src/duckstation-qt/mainwindow.cpp‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ bool QtHost::IsSystemValid()
121121
return s_system_valid;
122122
}
123123

124+
bool QtHost::IsFullscreenUIStarted()
125+
{
126+
return s_fullscreen_ui_started;
127+
}
128+
124129
const QString& QtHost::GetCurrentGameTitle()
125130
{
126131
return s_current_game_title;
@@ -1987,8 +1992,8 @@ bool MainWindow::shouldHideMouseCursor() const
19871992

19881993
bool MainWindow::shouldHideMainWindow() const
19891994
{
1990-
return Host::GetBoolSettingValue("Main", "HideMainWindowWhenRunning", false) ||
1991-
(QtHost::CanRenderToMainWindow() && isRenderingFullscreen()) || QtHost::InNoGUIMode();
1995+
return Host::GetBoolSettingValue("Main", "HideMainWindowWhenRunning", false) || QtHost::CanRenderToMainWindow() ||
1996+
QtHost::InNoGUIMode();
19921997
}
19931998

19941999
void MainWindow::switchToGameListView()
@@ -2616,7 +2621,8 @@ bool MainWindow::requestShutdown(bool allow_confirm /* = true */, bool allow_sav
26162621
save_state = save_cb->isChecked();
26172622

26182623
// Don't switch back to fullscreen when we're shutting down anyway.
2619-
lock.cancelResume();
2624+
if (!QtHost::IsFullscreenUIStarted())
2625+
lock.cancelResume();
26202626
}
26212627

26222628
// This is a little bit annoying. Qt will close everything down if we don't have at least one window visible,

‎src/duckstation-qt/qthost.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,7 @@ void EmuThread::confirmActionIfMemoryCardBusy(const QString& action, bool cancel
11661166
"seconds for it to finish saving.\n\nDo you want to %1 anyway?")
11671167
.arg(action)) != QMessageBox::No);
11681168

1169-
if (cancel_resume_on_accept)
1169+
if (cancel_resume_on_accept && !QtHost::IsFullscreenUIStarted())
11701170
lock.cancelResume();
11711171

11721172
Host::RunOnCPUThread([result, callback = std::move(callback)]() { callback(result); });

‎src/duckstation-qt/qthost.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,9 @@ bool ShouldShowDebugOptions();
382382
bool IsSystemValid();
383383
bool IsSystemPaused();
384384

385+
/// Returns true if fullscreen UI is requested.
386+
bool IsFullscreenUIStarted();
387+
385388
/// Returns true if any lock is in place.
386389
bool IsSystemLocked();
387390

0 commit comments

Comments
 (0)