Skip to content

Commit

Permalink
Merge pull request #12327 from AvaloniaUI/fix-macos-window-positioning
Browse files Browse the repository at this point in the history
Fix window incorrect positioning with window startup location CenterScreen on MacOS
  • Loading branch information
grokys authored Jul 27, 2023
2 parents 47988db + 5d2b9ed commit e394ca5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions native/Avalonia.Native/src/OSX/WindowBaseImpl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down

0 comments on commit e394ca5

Please sign in to comment.