From 1093c816d050e5cb85564f0964842a0b962321e7 Mon Sep 17 00:00:00 2001 From: "Avi Halachmi (:avih)" Date: Mon, 5 Oct 2015 21:15:52 +0300 Subject: [PATCH] gui: recording dialog modality: more resilience A very slight refactor of commit 9eadf3 to also handle a future case where the audio has a dialog but the GS doesn't (currently both conditions are false). --- pcsx2/gui/GlobalCommands.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/pcsx2/gui/GlobalCommands.cpp b/pcsx2/gui/GlobalCommands.cpp index f6d81d9b06..5aa1769805 100644 --- a/pcsx2/gui/GlobalCommands.cpp +++ b/pcsx2/gui/GlobalCommands.cpp @@ -385,12 +385,16 @@ namespace Implementations GetMTGS().WaitGS(); // make sure GS is in sync with the audio stream when we start. if (g_Pcsx2Recording) { // start recording - if (GSsetupRecording) { - // make the recording-config dialog[s] pseudo-modal also for the main PCSX2 window - // (it's already properly modal for the GS window) - if (GetMainFramePtr()) - GetMainFramePtr()->Disable(); + // make the recording setup dialog[s] pseudo-modal also for the main PCSX2 window + // (the GSdx dialog is already properly modal for the GS window) + bool needsMainFrameEnable = false; + if (GetMainFramePtr() && GetMainFramePtr()->IsEnabled()) { + needsMainFrameEnable = true; + GetMainFramePtr()->Disable(); + } + + if (GSsetupRecording) { // GSsetupRecording can be aborted/canceled by the user. Don't go on to record the audio if that happens. if (GSsetupRecording(g_Pcsx2Recording, NULL)) { if (SPU2setupRecording) SPU2setupRecording(g_Pcsx2Recording, NULL); @@ -398,15 +402,14 @@ namespace Implementations // recording dialog canceled by the user. align our state g_Pcsx2Recording ^= 1; } - - if (GetMainFramePtr()) - GetMainFramePtr()->Enable(); - } else { // the GS doesn't support recording. if (SPU2setupRecording) SPU2setupRecording(g_Pcsx2Recording, NULL); } + if (GetMainFramePtr() && needsMainFrameEnable) + GetMainFramePtr()->Enable(); + } else { // stop recording if (GSsetupRecording) GSsetupRecording(g_Pcsx2Recording, NULL);