Browse Source

prevent recursive calls during resize.

pull/6250/head
Dan Walmsley 5 years ago
parent
commit
1a0780a7a4
  1. 12
      native/Avalonia.Native/src/OSX/window.mm

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

@ -29,10 +29,12 @@ public:
IAvnMenu* _mainMenu;
bool _shown;
bool _inResize;
WindowBaseImpl(IAvnWindowBaseEvents* events, IAvnGlContext* gl)
{
_shown = false;
_inResize = false;
_mainMenu = nullptr;
BaseEvents = events;
_glContext = gl;
@ -277,6 +279,14 @@ public:
virtual HRESULT Resize(double x, double y) override
{
if(_inResize)
{
return S_OK;
}
_inResize = true;
START_COM_CALL;
@autoreleasepool
@ -312,6 +322,8 @@ public:
[StandardContainer setFrameSize:NSSize{x,y}];
[Window setContentSize:NSSize{x, y}];
_inResize = false;
return S_OK;
}
}

Loading…
Cancel
Save