Skip to content

Commit

Permalink
Merge pull request AvaloniaUI#8158 from AvaloniaUI/fixes/osx-nswindow…
Browse files Browse the repository at this point in the history
…-refactor-position

[OSX] nswindow refactor - ensure position property is consistent before window is open.
  • Loading branch information
maxkatz6 authored and danwalmsley committed May 19, 2022
1 parent f1053d1 commit db20d69
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions native/Avalonia.Native/src/OSX/WindowBaseImpl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -363,12 +363,17 @@
return E_POINTER;
}

auto frame = [Window frame];
if(Window != nullptr) {
auto frame = [Window frame];

ret->X = frame.origin.x;
ret->Y = frame.origin.y + frame.size.height;
ret->X = frame.origin.x;
ret->Y = frame.origin.y + frame.size.height;

*ret = ConvertPointY(*ret);
*ret = ConvertPointY(*ret);
} else
{
*ret = lastPositionSet;
}

return S_OK;
}
Expand Down

0 comments on commit db20d69

Please sign in to comment.