Qt: Fix Big Picture UI locking up after game list switch

This commit is contained in:
Stenzek 2023-11-04 21:23:43 +10:00 committed by Connor McLaughlin
parent c62bd4ce97
commit 66b779a77d
4 changed files with 8 additions and 5 deletions

View File

@ -537,10 +537,6 @@ void EmuThread::setSurfaceless(bool surfaceless)
if (!MTGS::IsOpen() || m_is_surfaceless == surfaceless)
return;
// If we went surfaceless and were running the fullscreen UI, stop MTGS running idle.
// Otherwise, we'll keep trying to present to nothing.
MTGS::SetRunIdle(!surfaceless && m_run_fullscreen_ui);
// This will call back to us on the MTGS thread.
m_is_surfaceless = surfaceless;
MTGS::UpdateDisplayWindow();

View File

@ -508,6 +508,12 @@ void GSGameChanged()
GSTextureReplacements::GameChanged();
}
bool GSHasDisplayWindow()
{
pxAssert(g_gs_device);
return (g_gs_device->GetWindowInfo().type != WindowInfo::Type::Surfaceless);
}
void GSResizeDisplayWindow(int width, int height, float scale)
{
g_gs_device->ResizeWindow(width, height, scale);

View File

@ -96,6 +96,7 @@ void GSPresentCurrentFrame();
void GSThrottlePresentation();
void GSGameChanged();
void GSSetDisplayAlignment(GSDisplayAlignment alignment);
bool GSHasDisplayWindow();
void GSResizeDisplayWindow(int width, int height, float scale);
void GSUpdateDisplayWindow();
void GSSetVSyncMode(VsyncMode mode);

View File

@ -324,7 +324,7 @@ void MTGS::MainLoop()
while (true)
{
if (s_run_idle_flag.load(std::memory_order_acquire) && VMManager::GetState() != VMState::Running)
if (s_run_idle_flag.load(std::memory_order_acquire) && VMManager::GetState() != VMState::Running && GSHasDisplayWindow())
{
if (!s_sem_event.CheckForWork())
{