Fix sound prefs window flickering dark when changing the volume

This commit is contained in:
elasota
2020-05-18 03:51:36 -04:00
parent afb9474340
commit 1abb542301

View File

@@ -727,6 +727,8 @@ void DoSoundPrefs (void)
short itemHit;
Boolean leaving;
PortabilityLayer::WindowManager *wm = PortabilityLayer::WindowManager::GetInstance();
BringUpDialog(&prefDlg, kSoundPrefsDialID, nullptr);
DrawSurface *surface = prefDlg->GetWindow()->GetDrawSurface();
@@ -741,6 +743,9 @@ void DoSoundPrefs (void)
SetDialogItemValue(prefDlg, kPlayMusicItem, (short)wasPlay);
leaving = false;
Window *exclStack = prefDlg->GetWindow();
wm->SwapExclusiveWindow(exclStack); // Push exclusive window
while (!leaving)
{
itemHit = prefDlg->ExecuteModal(SoundFilter);
@@ -844,6 +849,8 @@ void DoSoundPrefs (void)
}
}
wm->SwapExclusiveWindow(exclStack); // Pop exclusive window
prefDlg->Destroy();
}