aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTSRBerry <20988865+TSRBerry@users.noreply.github.com>2024-01-29 22:57:20 +0100
committerGitHub <noreply@github.com>2024-01-29 22:57:20 +0100
commit4e81ab4229c0c979dbc52f8b6b39328f2428c265 (patch)
tree3e5db9980e6c41cbac5f29b535d04f78bfd8cc68
parent4117c13377b51b83ff87b1d00393be1a5ab5bfff (diff)
Avalonia: Fix dialog issues caused by 1.1.1105 (#6211)1.1.1146
* Set _contentDialogOverlayWindow to null * Make CheckLaunchState async
-rw-r--r--src/Ryujinx.Ava/UI/Helpers/ContentDialogHelper.cs1
-rw-r--r--src/Ryujinx.Ava/UI/Windows/MainWindow.axaml.cs24
2 files changed, 8 insertions, 17 deletions
diff --git a/src/Ryujinx.Ava/UI/Helpers/ContentDialogHelper.cs b/src/Ryujinx.Ava/UI/Helpers/ContentDialogHelper.cs
index a57deb1a..0863cbaa 100644
--- a/src/Ryujinx.Ava/UI/Helpers/ContentDialogHelper.cs
+++ b/src/Ryujinx.Ava/UI/Helpers/ContentDialogHelper.cs
@@ -388,6 +388,7 @@ namespace Ryujinx.Ava.UI.Helpers
{
_contentDialogOverlayWindow.Content = null;
_contentDialogOverlayWindow.Close();
+ _contentDialogOverlayWindow = null;
}
return result;
diff --git a/src/Ryujinx.Ava/UI/Windows/MainWindow.axaml.cs b/src/Ryujinx.Ava/UI/Windows/MainWindow.axaml.cs
index 1aecbd04..ae26b651 100644
--- a/src/Ryujinx.Ava/UI/Windows/MainWindow.axaml.cs
+++ b/src/Ryujinx.Ava/UI/Windows/MainWindow.axaml.cs
@@ -263,7 +263,7 @@ namespace Ryujinx.Ava.UI.Windows
}
}
- private void CheckLaunchState()
+ private async Task CheckLaunchState()
{
if (OperatingSystem.IsLinux() && LinuxHelper.VmMaxMapCount < LinuxHelper.RecommendedVmMaxMapCount)
{
@@ -271,23 +271,11 @@ namespace Ryujinx.Ava.UI.Windows
if (LinuxHelper.PkExecPath is not null)
{
- Dispatcher.UIThread.Post(async () =>
- {
- if (OperatingSystem.IsLinux())
- {
- await ShowVmMaxMapCountDialog();
- }
- });
+ await Dispatcher.UIThread.InvokeAsync(ShowVmMaxMapCountDialog);
}
else
{
- Dispatcher.UIThread.Post(async () =>
- {
- if (OperatingSystem.IsLinux())
- {
- await ShowVmMaxMapCountWarning();
- }
- });
+ await Dispatcher.UIThread.InvokeAsync(ShowVmMaxMapCountWarning);
}
}
@@ -304,12 +292,12 @@ namespace Ryujinx.Ava.UI.Windows
{
ShowKeyErrorOnLoad = false;
- Dispatcher.UIThread.Post(async () => await UserErrorDialog.ShowUserErrorDialog(UserError.NoKeys));
+ await Dispatcher.UIThread.InvokeAsync(async () => await UserErrorDialog.ShowUserErrorDialog(UserError.NoKeys));
}
if (ConfigurationState.Instance.CheckUpdatesOnStart.Value && Updater.CanUpdate(false))
{
- Updater.BeginParse(this, false).ContinueWith(task =>
+ await Updater.BeginParse(this, false).ContinueWith(task =>
{
Logger.Error?.Print(LogClass.Application, $"Updater Error: {task.Exception}");
}, TaskContinuationOptions.OnlyOnFaulted);
@@ -404,7 +392,9 @@ namespace Ryujinx.Ava.UI.Windows
LoadApplications();
+#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
CheckLaunchState();
+#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
}
private void SetMainContent(Control content = null)