From 5f62a5752e8a00d70c556fc2f2732febe852bfdd Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Tue, 15 Sep 2020 18:04:31 -0400 Subject: [PATCH] pcsx2-gui: Pause and resume emulation when using `Screenshot As..` --- pcsx2/gui/MainMenuClicks.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pcsx2/gui/MainMenuClicks.cpp b/pcsx2/gui/MainMenuClicks.cpp index 2c182a1eb8..053ae408d4 100644 --- a/pcsx2/gui/MainMenuClicks.cpp +++ b/pcsx2/gui/MainMenuClicks.cpp @@ -924,10 +924,19 @@ void MainEmuFrame::Menu_Capture_Screenshot_Screenshot_As_Click(wxCommandEvent &e if (!CoreThread.IsOpen()) return; - wxFileDialog fileDialog(this, "Select a file", g_Conf->Folders.Snapshots.ToAscii(), wxEmptyString, "PNG files (*.png)|*.png", wxFD_SAVE | wxFD_OVERWRITE_PROMPT); + // Ensure emulation is paused so that the correct image is captured + bool wasPaused = CoreThread.IsPaused(); + if (!wasPaused) + CoreThread.Pause(); + + wxFileDialog fileDialog(this, _("Select a file"), g_Conf->Folders.Snapshots.ToAscii(), wxEmptyString, "PNG files (*.png)|*.png", wxFD_SAVE | wxFD_OVERWRITE_PROMPT); if (fileDialog.ShowModal() == wxID_OK) GSmakeSnapshot(fileDialog.GetPath()); + + // Resume emulation + if (!wasPaused) + CoreThread.Resume(); } #ifndef DISABLE_RECORDING