From 1a01f560cf31d8b2e6e657370999192b82186fc4 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Thu, 10 Dec 2020 17:10:04 +0000 Subject: [PATCH] dont crash if win32 options is cted on other platforms. --- src/Windows/Avalonia.Win32/Win32Platform.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Windows/Avalonia.Win32/Win32Platform.cs b/src/Windows/Avalonia.Win32/Win32Platform.cs index a43947a7ff..2a3625e31a 100644 --- a/src/Windows/Avalonia.Win32/Win32Platform.cs +++ b/src/Windows/Avalonia.Win32/Win32Platform.cs @@ -40,7 +40,11 @@ namespace Avalonia public class Win32PlatformOptions { public bool UseDeferredRendering { get; set; } = true; - public bool AllowEglInitialization { get; set; } = Win32Platform.WindowsVersion > new Version(6, 1); + + public bool AllowEglInitialization { get; set; } + = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && + Win32Platform.WindowsVersion > new Version(6, 1); + public bool? EnableMultitouch { get; set; } public bool OverlayPopups { get; set; } public bool UseWgl { get; set; }