From e18db92692d605962ddc9484b7a5d0d4ff5da91a Mon Sep 17 00:00:00 2001 From: Sour Date: Mon, 11 Nov 2024 09:28:22 +0900 Subject: [PATCH] UI: Update to Avalonia 11.2.0 --- UI/App.axaml.cs | 6 ++++++ UI/Program.cs | 2 +- UI/UI.csproj | 21 ++++++++++----------- UI/Views/OtherConsolesConfigView.axaml | 2 +- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/UI/App.axaml.cs b/UI/App.axaml.cs index 592b055bf..f5689ac77 100644 --- a/UI/App.axaml.cs +++ b/UI/App.axaml.cs @@ -4,6 +4,7 @@ using Avalonia.Controls.Platform; using Avalonia.Markup.Xaml; using Avalonia.Styling; +using Avalonia.Threading; using Mesen.Config; using Mesen.Interop; using Mesen.Localization; @@ -26,6 +27,11 @@ public override void Initialize() } else { RequestedThemeVariant = ConfigManager.Config.Preferences.Theme == MesenTheme.Dark ? ThemeVariant.Dark : ThemeVariant.Light; } + + Dispatcher.UIThread.UnhandledException += (s, e) => { + MesenMsgBox.ShowException(e.Exception); + e.Handled = true; + }; AvaloniaXamlLoader.Load(this); ResourceHelper.LoadResources(); diff --git a/UI/Program.cs b/UI/Program.cs index 89615428c..a4dd847ff 100644 --- a/UI/Program.cs +++ b/UI/Program.cs @@ -161,7 +161,7 @@ public static AppBuilder BuildAvaloniaApp() .With(new X11PlatformOptions { EnableInputFocusProxy = Environment.GetEnvironmentVariable("XDG_CURRENT_DESKTOP") == "gamescope", }) - .With(new AvaloniaNativePlatformOptions { }) + .With(new AvaloniaNativePlatformOptions { RenderingMode = new AvaloniaNativeRenderingMode[] { AvaloniaNativeRenderingMode.OpenGl, AvaloniaNativeRenderingMode.Software } }) .LogToTrace(); } } diff --git a/UI/UI.csproj b/UI/UI.csproj index 95488404b..d0e61603a 100644 --- a/UI/UI.csproj +++ b/UI/UI.csproj @@ -104,19 +104,18 @@ - - - - - - - - - + + + + + + + + + - - + diff --git a/UI/Views/OtherConsolesConfigView.axaml b/UI/Views/OtherConsolesConfigView.axaml index 1c2d63cbd..bec5e20e1 100644 --- a/UI/Views/OtherConsolesConfigView.axaml +++ b/UI/Views/OtherConsolesConfigView.axaml @@ -24,7 +24,7 @@ - +