Skip to content

Commit

Permalink
Change MoveTo Behavior for macOS Sonoma
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjbauer committed Oct 26, 2023
1 parent ca80982 commit 74b9459
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Photino.NET/PhotinoWindow.NET.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ public partial class PhotinoWindow
/// </value>
public static bool IsMacOsPlatform => RuntimeInformation.IsOSPlatform(OSPlatform.OSX);

/// <summary>
/// Indicates the version of MacOS
/// </summary>
public static Version MacOsVersion => IsMacOsPlatform ? Version.Parse(RuntimeInformation.OSDescription.Split(' ')[1]) : null;

/// <summary>
/// Indicates whether the current platform is Linux.
/// </summary>
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 74b9459

Please sign in to comment.