From 5d2b9edec35c1a8f159b85ac547979a349855a94 Mon Sep 17 00:00:00 2001 From: daniilpavliuchyk Date: Tue, 25 Jul 2023 19:27:16 +0300 Subject: [PATCH] Fix window incorrect positioning with window startup location CenterScreen on MacOS --- native/Avalonia.Native/src/OSX/WindowBaseImpl.mm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/native/Avalonia.Native/src/OSX/WindowBaseImpl.mm b/native/Avalonia.Native/src/OSX/WindowBaseImpl.mm index b954bdd4e31..1a4f979ce76 100644 --- a/native/Avalonia.Native/src/OSX/WindowBaseImpl.mm +++ b/native/Avalonia.Native/src/OSX/WindowBaseImpl.mm @@ -151,6 +151,14 @@ @autoreleasepool { if (Window != nullptr) { + auto frame = [Window frame]; + + AvnPoint point; + point.X = frame.origin.x; + point.Y = frame.origin.y + frame.size.height; + + lastPositionSet = ConvertPointY(point); + hasPosition = true; [Window orderOut:Window]; }