Browse Source

prevent stack overflow entering fs mode.

demo1
Dan Walmsley 6 years ago
parent
commit
53fecec28a
  1. 9
      native/Avalonia.Native/src/OSX/window.mm

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

@ -1016,12 +1016,14 @@ NSArray* AllLoopModes = [NSArray arrayWithObjects: NSDefaultRunLoopMode, NSEvent
NSView* _content; NSView* _content;
NSVisualEffectView* _blurBehind; NSVisualEffectView* _blurBehind;
double _titleBarHeightHint; double _titleBarHeightHint;
bool _settingSize;
} }
-(AutoFitContentView* _Nonnull) initWithContent:(NSView *)content -(AutoFitContentView* _Nonnull) initWithContent:(NSView *)content
{ {
_titleBarHeightHint = -1; _titleBarHeightHint = -1;
_content = content; _content = content;
_settingSize = false;
[self setAutoresizesSubviews:true]; [self setAutoresizesSubviews:true];
[self setWantsLayer:true]; [self setWantsLayer:true];
@ -1073,6 +1075,12 @@ NSArray* AllLoopModes = [NSArray arrayWithObjects: NSDefaultRunLoopMode, NSEvent
-(void)setFrameSize:(NSSize)newSize -(void)setFrameSize:(NSSize)newSize
{ {
if(_settingSize)
{
return;
}
_settingSize = true;
[super setFrameSize:newSize]; [super setFrameSize:newSize];
[_blurBehind setFrameSize:newSize]; [_blurBehind setFrameSize:newSize];
@ -1093,6 +1101,7 @@ NSArray* AllLoopModes = [NSArray arrayWithObjects: NSDefaultRunLoopMode, NSEvent
[_titleBarMaterial setFrame:tbar]; [_titleBarMaterial setFrame:tbar];
tbar.size.height = height < 1 ? 0 : 1; tbar.size.height = height < 1 ? 0 : 1;
[_titleBarUnderline setFrame:tbar]; [_titleBarUnderline setFrame:tbar];
_settingSize = false;
} }
-(void) SetContent: (NSView* _Nonnull) content -(void) SetContent: (NSView* _Nonnull) content

Loading…
Cancel
Save