Browse Source

fix window positioning when first shown.

pull/1977/head
Dan Walmsley 8 years ago
parent
commit
3e6007dec9
  1. 7
      src/Avalonia.Native.OSX/window.mm

7
src/Avalonia.Native.OSX/window.mm

@ -19,11 +19,16 @@ public:
AvnView* View;
AvnWindow* Window;
ComPtr<IAvnWindowBaseEvents> BaseEvents;
AvnPoint lastPositionSet;
WindowBaseImpl(IAvnWindowBaseEvents* events)
{
BaseEvents = events;
View = [[AvnView alloc] initWithParent:this];
Window = [[AvnWindow alloc] initWithParent:this];
lastPositionSet.X = 100;
lastPositionSet.Y = 100;
[Window setStyleMask:NSWindowStyleMaskBorderless];
[Window setBackingType:NSBackingStoreBuffered];
[Window setContentView: View];
@ -31,6 +36,7 @@ public:
virtual HRESULT Show()
{
SetPosition(lastPositionSet);
UpdateStyle();
[Window makeKeyAndOrderFront:Window];
return S_OK;
@ -120,6 +126,7 @@ public:
virtual void SetPosition (AvnPoint point)
{
lastPositionSet = point;
[Window setFrameTopLeftPoint:ToNSPoint(ConvertPointY(point))];
}

Loading…
Cancel
Save