Skip to content

Commit f5abe13

Browse files
committed
Fix error when switching to fullscreen
This error only happens after pause screen opened once. Changes to MTGS.cpp fix an unrelated logic error I noticed, seemingly benign.
1 parent cb53b89 commit f5abe13

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

pcsx2/ImGui/ImGuiManager.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,14 @@ void ImGuiManager::UpdateScale()
250250
s_global_scale = scale;
251251
SetStyle();
252252

253+
// can't do this in the middle of a frame
254+
ImGui::EndFrame();
253255
if (!AddImGuiFonts(HasFullscreenFonts()))
254256
pxFailRel("Failed to create ImGui font text");
255257

256258
if (!g_gs_device->UpdateImGuiFontTexture())
257259
pxFailRel("Failed to recreate font texture after scale+resize");
260+
NewFrame();
258261
}
259262

260263
void ImGuiManager::NewFrame()

pcsx2/MTGS.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -962,9 +962,11 @@ void MTGS::ResizeDisplayWindow(int width, int height, float scale)
962962

963963
// If we're paused, re-present the current frame at the new window size.
964964
if (VMManager::GetState() == VMState::Paused)
965+
{
965966
GSPresentCurrentFrame();
966967
//New drawrect calculated in GSPresentCurrentFrame(), so resize imgui
967968
GSResizeImGUIOnly(false);
969+
}
968970

969971
});
970972
}

0 commit comments

Comments
 (0)