Browse Source

Don't call virtual method from ctor.

And remove unneeded checks for already-existing `Window` (this method is always called from ctor).
pull/10265/head
Steven Kirk 4 years ago
parent
commit
5346344d12
  1. 19
      native/Avalonia.Native/src/OSX/WindowBaseImpl.mm

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

@ -580,21 +580,12 @@ void WindowBaseImpl::CleanNSWindow() {
} }
} }
void WindowBaseImpl::CreateNSWindow(bool isDialog) { void WindowBaseImpl::CreateNSWindow(bool usePanel) {
if (isDialog) { if (usePanel) {
if (![Window isKindOfClass:[AvnPanel class]]) { Window = [[AvnPanel alloc] initWithParent:this contentRect:NSRect{0, 0, lastSize} styleMask:NSWindowStyleMaskBorderless];
CleanNSWindow(); [Window setHidesOnDeactivate:false];
Window = [[AvnPanel alloc] initWithParent:this contentRect:NSRect{0, 0, lastSize} styleMask:GetStyle()];
[Window setHidesOnDeactivate:false];
}
} else { } else {
if (![Window isKindOfClass:[AvnWindow class]]) { Window = [[AvnWindow alloc] initWithParent:this contentRect:NSRect{0, 0, lastSize} styleMask:NSWindowStyleMaskBorderless];
CleanNSWindow();
Window = [[AvnWindow alloc] initWithParent:this contentRect:NSRect{0, 0, lastSize} styleMask:GetStyle()];
}
} }
} }

Loading…
Cancel
Save