From 93560856e43a52c30f759c5d8ed9342e82e6a136 Mon Sep 17 00:00:00 2001 From: maotovisk Date: Fri, 17 Jul 2026 18:36:38 -0300 Subject: [PATCH] fix: use conditional wayland initalization for program start --- MapWizard.Desktop/Program.cs | 32 ++++++++++++++---------- MapWizard.Desktop/Views/MainWindow.axaml | 1 + 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/MapWizard.Desktop/Program.cs b/MapWizard.Desktop/Program.cs index b4f7baf..ab7c92e 100644 --- a/MapWizard.Desktop/Program.cs +++ b/MapWizard.Desktop/Program.cs @@ -28,21 +28,27 @@ public static void Main(string[] args) // Avalonia configuration, don't remove; also used by visual designer. private static AppBuilder BuildAvaloniaApp(bool forceSoftwareRendering) - => AppBuilder.Configure() + { + var app = AppBuilder.Configure() .UsePlatformDetect() - .UseWayland() .WithInterFont() - .With(new X11PlatformOptions() - { - RenderingMode = forceSoftwareRendering - ? [X11RenderingMode.Software] - : - [ - X11RenderingMode.Glx, - X11RenderingMode.Vulkan, - X11RenderingMode.Software - ] - }) .LogToTrace(); + + if (OperatingSystem.IsLinux()) + app.UseWayland() + .With(new X11PlatformOptions() + { + RenderingMode = forceSoftwareRendering + ? [X11RenderingMode.Software] + : + [ + X11RenderingMode.Glx, + X11RenderingMode.Vulkan, + X11RenderingMode.Software + ] + }); + + return app; + } } diff --git a/MapWizard.Desktop/Views/MainWindow.axaml b/MapWizard.Desktop/Views/MainWindow.axaml index 0954235..24fc498 100644 --- a/MapWizard.Desktop/Views/MainWindow.axaml +++ b/MapWizard.Desktop/Views/MainWindow.axaml @@ -13,6 +13,7 @@ xmlns:settings="clr-namespace:MapWizard.Desktop.Views.Settings" x:Class="MapWizard.Desktop.Views.MainWindow" x:DataType="vm:MainWindowViewModel" + WindowDecorations="BorderOnly" IsMenuVisible="False" MinWidth="800" MinHeight="600"