Skip to content

Commit

Permalink
Ava: Fix regressions by rewriting CheckLaunchState (#5728)
Browse files Browse the repository at this point in the history
  • Loading branch information
AcK77 authored Sep 26, 2023
1 parent 4744bde commit 7f2fb04
Showing 1 changed file with 26 additions and 12 deletions.
38 changes: 26 additions & 12 deletions src/Ryujinx.Ava/UI/Windows/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,32 +265,46 @@ private static async Task ShowVmMaxMapCountDialog()

private void CheckLaunchState()
{
if (ShowKeyErrorOnLoad)
{
ShowKeyErrorOnLoad = false;

UserErrorDialog.ShowUserErrorDialog(UserError.NoKeys).Wait();
}

if (OperatingSystem.IsLinux() && LinuxHelper.VmMaxMapCount < LinuxHelper.RecommendedVmMaxMapCount)
{
Logger.Warning?.Print(LogClass.Application, $"The value of vm.max_map_count is lower than {LinuxHelper.RecommendedVmMaxMapCount}. ({LinuxHelper.VmMaxMapCount})");

if (LinuxHelper.PkExecPath is not null)
{
ShowVmMaxMapCountDialog().Wait();
Dispatcher.UIThread.Post(async () =>
{
if (OperatingSystem.IsLinux())
{
await ShowVmMaxMapCountDialog();
}
});
}
else
{
ShowVmMaxMapCountWarning().Wait();
Dispatcher.UIThread.Post(async () =>
{
if (OperatingSystem.IsLinux())
{
await ShowVmMaxMapCountWarning();
}
});
}
}

if (_deferLoad)
if (!ShowKeyErrorOnLoad)
{
if (_deferLoad)
{
_deferLoad = false;

ViewModel.LoadApplication(_launchPath, _startFullscreen).Wait();
}
}
else
{
_deferLoad = false;
ShowKeyErrorOnLoad = false;

ViewModel.LoadApplication(_launchPath, _startFullscreen).Wait();
Dispatcher.UIThread.Post(async () => await UserErrorDialog.ShowUserErrorDialog(UserError.NoKeys));
}

if (ConfigurationState.Instance.CheckUpdatesOnStart.Value && Updater.CanUpdate(false))
Expand Down

0 comments on commit 7f2fb04

Please sign in to comment.