Skip to content

Commit

Permalink
only center if window didnt get a position.
Browse files Browse the repository at this point in the history
  • Loading branch information
danwalmsley committed May 19, 2022
1 parent 24164ca commit c1dce5c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions native/Avalonia.Native/src/OSX/WindowBaseImpl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@
if(hasPosition)
{
SetPosition(lastPositionSet);
} else
{
[Window center];
}

UpdateStyle();
Expand Down Expand Up @@ -287,12 +290,12 @@
}

@try {
lastSize = NSSize {x, y};

if (!_shown) {
BaseEvents->Resized(AvnSize{x, y}, reason);
}

lastSize = NSSize {x, y};

if(Window != nullptr) {
[Window setContentSize:lastSize];
}
Expand Down Expand Up @@ -577,7 +580,6 @@
[Window setContentMaxSize:lastMaxSize];

[Window setOpaque:false];
[Window center];

if (lastMenu != nullptr) {
[GetWindowProtocol() applyMenu:lastMenu];
Expand Down

0 comments on commit c1dce5c

Please sign in to comment.