Skip to content

Commit

Permalink
Qt: Fix Big Picture UI locking up after game list switch
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Nov 5, 2023
1 parent c62bd4c commit 66b779a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
4 changes: 0 additions & 4 deletions pcsx2-qt/QtHost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 6 additions & 0 deletions pcsx2/GS/GS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions pcsx2/GS/GS.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion pcsx2/MTGS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
{
Expand Down

0 comments on commit 66b779a

Please sign in to comment.