Browse Source

borderless windows can change state.

pull/3849/head
Dan Walmsley 7 years ago
parent
commit
66d3f44cab
  1. 19
      native/Avalonia.Native/src/OSX/window.mm

19
native/Avalonia.Native/src/OSX/window.mm

@ -409,6 +409,7 @@ private:
SystemDecorations _decorations; SystemDecorations _decorations;
AvnWindowState _lastWindowState; AvnWindowState _lastWindowState;
bool _inSetWindowState; bool _inSetWindowState;
NSRect _preZoomSize;
bool _transitioningWindowState; bool _transitioningWindowState;
FORWARD_IUNKNOWN() FORWARD_IUNKNOWN()
@ -706,6 +707,11 @@ private:
auto currentState = _lastWindowState; auto currentState = _lastWindowState;
_lastWindowState = state; _lastWindowState = state;
if(currentState == Normal)
{
_preZoomSize = [Window frame];
}
if(_shown) if(_shown)
{ {
switch (state) { switch (state) {
@ -760,7 +766,18 @@ private:
if(IsZoomed()) if(IsZoomed())
{ {
DoZoom(); if(_decorations == SystemDecorationsFull)
{
DoZoom();
}
else
{
[Window setFrame:_preZoomSize display:true];
auto newFrame = [Window contentRectForFrameRect:[Window frame]].size;
[View setFrameSize:newFrame];
}
} }
break; break;
} }

Loading…
Cancel
Save