FullscreenUI: Fix system not unpausing after HC disable popup

This commit is contained in:
Stenzek 2025-03-15 16:11:58 +10:00
parent 27fc7de07a
commit e3cb3d029b
No known key found for this signature in database
1 changed files with 9 additions and 11 deletions

View File

@ -2064,10 +2064,9 @@ void Host::ConfirmMessageAsync(std::string_view title, std::string_view message,
{
GPUThread::RunOnThread([title = std::string(title), message = std::string(message), callback = std::move(callback),
yes_text = std::string(yes_text), no_text = std::string(no_text), needs_pause]() mutable {
if (!FullscreenUI::Initialize())
{
callback(false);
// Need to reset run idle state _again_ after displaying.
auto final_callback = [callback = std::move(callback), needs_pause](bool result) {
FullscreenUI::UpdateRunIdleState();
if (needs_pause)
{
Host::RunOnCPUThread([]() {
@ -2075,16 +2074,15 @@ void Host::ConfirmMessageAsync(std::string_view title, std::string_view message,
System::PauseSystem(false);
});
}
return;
}
// Need to reset run idle state _again_ after displaying.
auto final_callback = [callback = std::move(callback)](bool result) {
FullscreenUI::UpdateRunIdleState();
callback(result);
};
if (!FullscreenUI::Initialize())
{
final_callback(false);
return;
}
ImGuiFullscreen::OpenConfirmMessageDialog(std::move(title), std::move(message), std::move(final_callback),
fmt::format(ICON_FA_CHECK " {}", yes_text),
fmt::format(ICON_FA_TIMES " {}", no_text));