Skip to content

Commit

Permalink
UI: Intel Mac warning
Browse files Browse the repository at this point in the history
Upon launch, shows a warning about using an Intel Mac. This will only show once every boot. You can only turn it off by getting a better system.
  • Loading branch information
GreemDev committed Jan 18, 2025
1 parent 6fca449 commit 4868ffa
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/Ryujinx/UI/Windows/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Linq;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -136,6 +137,8 @@ protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
base.OnApplyTemplate(e);

NotificationHelper.SetNotificationManager(this);

ShowIntelMacWarningAsync();

Check warning on line 141 in src/Ryujinx/UI/Windows/MainWindow.axaml.cs

View workflow job for this annotation

GitHub Actions / Release MacOS universal

Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.

Check warning on line 141 in src/Ryujinx/UI/Windows/MainWindow.axaml.cs

View workflow job for this annotation

GitHub Actions / Release MacOS universal

Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.

Check warning on line 141 in src/Ryujinx/UI/Windows/MainWindow.axaml.cs

View workflow job for this annotation

GitHub Actions / Release MacOS universal

Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.

Check warning on line 141 in src/Ryujinx/UI/Windows/MainWindow.axaml.cs

View workflow job for this annotation

GitHub Actions / Release MacOS universal

Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.

Check warning on line 141 in src/Ryujinx/UI/Windows/MainWindow.axaml.cs

View workflow job for this annotation

GitHub Actions / Release for linux-x64

Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.

Check warning on line 141 in src/Ryujinx/UI/Windows/MainWindow.axaml.cs

View workflow job for this annotation

GitHub Actions / Release for linux-arm64

Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.
}

private void OnScalingChanged(object sender, EventArgs e)
Expand Down Expand Up @@ -731,5 +734,22 @@ await ContentDialogHelper.ShowTextDialog(
(int)Symbol.Checkmark);
});
}

private static bool _intelMacWarningShown;

public static async Task ShowIntelMacWarningAsync()
{
if (!_intelMacWarningShown &&
(OperatingSystem.IsMacOS() &&
(RuntimeInformation.OSArchitecture == Architecture.X64 ||
RuntimeInformation.OSArchitecture == Architecture.X86)))
{
_intelMacWarningShown = true;

await Dispatcher.UIThread.InvokeAsync(async () => await ContentDialogHelper.CreateWarningDialog(
"Intel Mac Warning",
"Intel Macs are not supported and will not work properly.\nIf you continue, do not come to our Discord asking for support."));
}
}
}
}

0 comments on commit 4868ffa

Please sign in to comment.