aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAc_K <Acoustik666@gmail.com>2023-06-03 05:37:00 +0200
committerGitHub <noreply@github.com>2023-06-03 03:37:00 +0000
commitc545c598512f57de2d178f78095f8bc7b31f07c3 (patch)
tree4297a36b4e0274f7f16c69e3c5b588f945190964 /src
parent96ea4e8c8e38f42073c1f8d7fb66c89a663e95e0 (diff)
ava: Fix exit dialog while guest is running. (#5207)1.1.856
* ava: Fix exit dialog while guest is running. There is currently an issue while a game runs, the content dialog creation method check if `IsGameRunning` is true to show the popup. But the condition here is wrong (`window` is null) so it throw a NullException silently in `Dispatcher.UIThread`. This is now fixed by using the right casting. * improve condition * Fix spacing
Diffstat (limited to 'src')
-rw-r--r--src/Ryujinx.Ava/UI/Helpers/ContentDialogHelper.cs2
-rw-r--r--src/Ryujinx.Ava/UI/Windows/MainWindow.axaml.cs16
2 files changed, 9 insertions, 9 deletions
diff --git a/src/Ryujinx.Ava/UI/Helpers/ContentDialogHelper.cs b/src/Ryujinx.Ava/UI/Helpers/ContentDialogHelper.cs
index d85895fc..045d508c 100644
--- a/src/Ryujinx.Ava/UI/Helpers/ContentDialogHelper.cs
+++ b/src/Ryujinx.Ava/UI/Helpers/ContentDialogHelper.cs
@@ -318,7 +318,7 @@ namespace Ryujinx.Ava.UI.Helpers
Window parent = GetMainWindow();
- if (parent is { IsActive: true } and MainWindow window && window.ViewModel.IsGameRunning)
+ if (parent != null && parent.IsActive && (parent as MainWindow).ViewModel.IsGameRunning)
{
contentDialogOverlayWindow = new()
{
diff --git a/src/Ryujinx.Ava/UI/Windows/MainWindow.axaml.cs b/src/Ryujinx.Ava/UI/Windows/MainWindow.axaml.cs
index cf84807e..66988c4b 100644
--- a/src/Ryujinx.Ava/UI/Windows/MainWindow.axaml.cs
+++ b/src/Ryujinx.Ava/UI/Windows/MainWindow.axaml.cs
@@ -519,14 +519,14 @@ namespace Ryujinx.Ava.UI.Windows
private void ConfirmExit()
{
Dispatcher.UIThread.InvokeAsync(async () =>
- {
- ViewModel.IsClosing = await ContentDialogHelper.CreateExitDialog();
-
- if (ViewModel.IsClosing)
- {
- Close();
- }
- });
+ {
+ ViewModel.IsClosing = await ContentDialogHelper.CreateExitDialog();
+
+ if (ViewModel.IsClosing)
+ {
+ Close();
+ }
+ });
}
public async void LoadApplications()