From f9d9e6aa61ee45c7d605441ea77a6892a1f07ce8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 14 Apr 2022 15:58:03 +0900 Subject: [PATCH] Ensure popup dialogs are hidden before running any associated actions --- osu.Game/Overlays/Dialog/PopupDialog.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Dialog/PopupDialog.cs b/osu.Game/Overlays/Dialog/PopupDialog.cs index a70a7f26cc..f5e6aed41b 100644 --- a/osu.Game/Overlays/Dialog/PopupDialog.cs +++ b/osu.Game/Overlays/Dialog/PopupDialog.cs @@ -87,10 +87,13 @@ namespace osu.Game.Overlays.Dialog { if (actionInvoked) return; + // Hide the dialog before running the action. + // This is important as the code which is performed may check for a dialog being present (ie. `OsuGame.PerformFromScreen`) + // and we don't want it to see the already dismissed dialog. + Hide(); + actionInvoked = true; action?.Invoke(); - - Hide(); }; } }