From d1e63624e1dbbc0168685d6ea83d73da91ecc9ad Mon Sep 17 00:00:00 2001 From: mariobob <13618350+mariobob@users.noreply.github.com> Date: Fri, 17 Oct 2025 22:47:45 +0200 Subject: [PATCH] Fix rewind selector UI freezing issue --- src/core/gpu_thread.cpp | 3 ++- src/core/gpu_thread.h | 1 + src/core/system.cpp | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/core/gpu_thread.cpp b/src/core/gpu_thread.cpp index eff5cdf32..8253b6f00 100644 --- a/src/core/gpu_thread.cpp +++ b/src/core/gpu_thread.cpp @@ -1478,7 +1478,8 @@ void GPUThread::UpdateRunIdle() static_cast(RunIdleReason::SystemPaused) | static_cast(RunIdleReason::LoadingScreenActive); static constexpr u8 ACTIVATE_MASK = - static_cast(RunIdleReason::FullscreenUIActive) | static_cast(RunIdleReason::LoadingScreenActive); + static_cast(RunIdleReason::FullscreenUIActive) | static_cast(RunIdleReason::LoadingScreenActive) | + static_cast(RunIdleReason::RewindSelectorActive); const bool new_flag = (g_gpu_device && ((s_state.run_idle_reasons & REQUIRE_MASK) != 0) && ((s_state.run_idle_reasons & ACTIVATE_MASK) != 0)); diff --git a/src/core/gpu_thread.h b/src/core/gpu_thread.h index 42f03c6c4..062327704 100644 --- a/src/core/gpu_thread.h +++ b/src/core/gpu_thread.h @@ -37,6 +37,7 @@ enum class RunIdleReason : u8 SystemPaused = (1 << 1), FullscreenUIActive = (1 << 2), LoadingScreenActive = (1 << 3), + RewindSelectorActive = (1 << 4), }; /// Starts Big Picture UI. diff --git a/src/core/system.cpp b/src/core/system.cpp index 27e328d68..bd66748ea 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -5301,6 +5301,9 @@ void System::OpenRewindStateSelector() s_state.rewind_selector_states = GetAvailableRewindStates(); s_state.rewind_selector_index = 0; + // Set the run idle reason so the GPU thread keeps processing events + GPUThread::SetRunIdleReason(GPUThread::RunIdleReason::RewindSelectorActive, true); + // Pause the game s_state.was_paused_before_rewind_selector = GPUThread::IsSystemPaused(); if (!s_state.was_paused_before_rewind_selector) @@ -5319,6 +5322,9 @@ void System::CloseRewindStateSelector() // Unpause if it wasn't paused before if (GPUThread::IsSystemPaused() && !s_state.was_paused_before_rewind_selector) Host::RunOnCPUThread([]() { System::PauseSystem(false); }); + + // Clear the run idle reason + GPUThread::SetRunIdleReason(GPUThread::RunIdleReason::RewindSelectorActive, false); } bool System::IsRewindStateSelectorOpen()