From 74b94598f0f78ea545950a8de76f836ba998ef23 Mon Sep 17 00:00:00 2001 From: Philipp Bauer Date: Thu, 26 Oct 2023 10:27:18 -0500 Subject: [PATCH] Change MoveTo Behavior for macOS Sonoma --- Photino.NET/PhotinoWindow.NET.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Photino.NET/PhotinoWindow.NET.cs b/Photino.NET/PhotinoWindow.NET.cs index 870375a..9be1a58 100644 --- a/Photino.NET/PhotinoWindow.NET.cs +++ b/Photino.NET/PhotinoWindow.NET.cs @@ -79,6 +79,11 @@ public partial class PhotinoWindow /// public static bool IsMacOsPlatform => RuntimeInformation.IsOSPlatform(OSPlatform.OSX); + /// + /// Indicates the version of MacOS + /// + public static Version MacOsVersion => IsMacOsPlatform ? Version.Parse(RuntimeInformation.OSDescription.Split(' ')[1]) : null; + /// /// Indicates whether the current platform is Linux. /// @@ -1597,7 +1602,11 @@ public PhotinoWindow MoveTo(Point location, bool allowOutsideWorkArea = false) // project files it is commented to be expected behavior for macOS. // There is some code trying to mitigate this problem but it might // not work as expected. Further investigation is necessary. - if (IsMacOsPlatform) + // Update: + // This behavior seems to have changed with macOS Sonoma. + // Therefore we determine the version of macOS and only apply the + // workaround for older versions. + if (IsMacOsPlatform && MacOsVersion.Major < 23) { var workArea = MainMonitor.WorkArea.Size; location.Y = location.Y >= 0