diff --git a/native/Avalonia.Native/src/OSX/PopupImpl.mm b/native/Avalonia.Native/src/OSX/PopupImpl.mm index 7ed780359d9..b29b44b6cc9 100644 --- a/native/Avalonia.Native/src/OSX/PopupImpl.mm +++ b/native/Avalonia.Native/src/OSX/PopupImpl.mm @@ -25,17 +25,13 @@ PopupImpl(IAvnWindowEvents* events, IAvnGlContext* gl) : WindowBaseImpl(events, gl) { WindowEvents = events; + [Window setLevel:NSPopUpMenuWindowLevel]; } protected: virtual NSWindowStyleMask GetStyle() override { return NSWindowStyleMaskBorderless; } - - virtual void OnInitialiseNSWindow () override - { - [Window setLevel:NSPopUpMenuWindowLevel]; - } public: virtual bool ShouldTakeFocusOnShow() override diff --git a/native/Avalonia.Native/src/OSX/WindowBaseImpl.h b/native/Avalonia.Native/src/OSX/WindowBaseImpl.h index 040ba39b6d4..787827c9b49 100644 --- a/native/Avalonia.Native/src/OSX/WindowBaseImpl.h +++ b/native/Avalonia.Native/src/OSX/WindowBaseImpl.h @@ -106,8 +106,6 @@ BEGIN_INTERFACE_MAP() virtual NSWindowStyleMask GetStyle(); void UpdateStyle(); - - virtual void OnInitialiseNSWindow (); private: void CreateNSWindow (bool isDialog); diff --git a/native/Avalonia.Native/src/OSX/WindowBaseImpl.mm b/native/Avalonia.Native/src/OSX/WindowBaseImpl.mm index 38d34720efb..289694a9b87 100644 --- a/native/Avalonia.Native/src/OSX/WindowBaseImpl.mm +++ b/native/Avalonia.Native/src/OSX/WindowBaseImpl.mm @@ -566,11 +566,6 @@ } } -void WindowBaseImpl::OnInitialiseNSWindow() -{ - -} - void WindowBaseImpl::InitialiseNSWindow() { if(Window != nullptr) { [Window setContentView:StandardContainer]; @@ -593,8 +588,6 @@ [GetWindowProtocol() showWindowMenuWithAppMenu]; } } - - OnInitialiseNSWindow(); } } diff --git a/native/Avalonia.Native/src/OSX/WindowImpl.h b/native/Avalonia.Native/src/OSX/WindowImpl.h index 627e29c03d0..b4b1d4e70b8 100644 --- a/native/Avalonia.Native/src/OSX/WindowImpl.h +++ b/native/Avalonia.Native/src/OSX/WindowImpl.h @@ -93,8 +93,6 @@ BEGIN_INTERFACE_MAP() virtual bool IsDialog() override; - virtual void OnInitialiseNSWindow() override; - virtual void BringToFront () override; bool CanBecomeKeyWindow (); @@ -103,6 +101,7 @@ BEGIN_INTERFACE_MAP() virtual NSWindowStyleMask GetStyle() override; private: + void OnInitialiseNSWindow(); NSString *_lastTitle; }; diff --git a/native/Avalonia.Native/src/OSX/WindowImpl.mm b/native/Avalonia.Native/src/OSX/WindowImpl.mm index e7c91d3a76c..782c8b80dcc 100644 --- a/native/Avalonia.Native/src/OSX/WindowImpl.mm +++ b/native/Avalonia.Native/src/OSX/WindowImpl.mm @@ -23,6 +23,8 @@ _lastTitle = @""; _parent = nullptr; WindowEvents = events; + + OnInitialiseNSWindow(); } void WindowImpl::HideOrShowTrafficLights() { @@ -40,6 +42,7 @@ void WindowImpl::OnInitialiseNSWindow(){ [GetWindowProtocol() setCanBecomeKeyWindow:true]; + [Window disableCursorRects]; [Window setTabbingMode:NSWindowTabbingModeDisallowed]; [Window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];