Skip to content

Commit c1dce5c

Browse files
committed
only center if window didnt get a position.
1 parent 24164ca commit c1dce5c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

native/Avalonia.Native/src/OSX/WindowBaseImpl.mm

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@
9494
if(hasPosition)
9595
{
9696
SetPosition(lastPositionSet);
97+
} else
98+
{
99+
[Window center];
97100
}
98101

99102
UpdateStyle();
@@ -287,12 +290,12 @@
287290
}
288291

289292
@try {
293+
lastSize = NSSize {x, y};
294+
290295
if (!_shown) {
291296
BaseEvents->Resized(AvnSize{x, y}, reason);
292297
}
293298

294-
lastSize = NSSize {x, y};
295-
296299
if(Window != nullptr) {
297300
[Window setContentSize:lastSize];
298301
}
@@ -577,7 +580,6 @@
577580
[Window setContentMaxSize:lastMaxSize];
578581

579582
[Window setOpaque:false];
580-
[Window center];
581583

582584
if (lastMenu != nullptr) {
583585
[GetWindowProtocol() applyMenu:lastMenu];

0 commit comments

Comments
 (0)