Skip to content

Commit

Permalink
Merge pull request AvaloniaUI#8258 from AvaloniaUI/fixes/osx-keyboard…
Browse files Browse the repository at this point in the history
…-input

OSX: fix call to virtual method from ctor.
  • Loading branch information
danwalmsley committed Jun 3, 2022
1 parent bd6d665 commit 8499a55
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 16 deletions.
6 changes: 1 addition & 5 deletions native/Avalonia.Native/src/OSX/PopupImpl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions native/Avalonia.Native/src/OSX/WindowBaseImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ BEGIN_INTERFACE_MAP()
virtual NSWindowStyleMask GetStyle();

void UpdateStyle();

virtual void OnInitialiseNSWindow ();

private:
void CreateNSWindow (bool isDialog);
Expand Down
7 changes: 0 additions & 7 deletions native/Avalonia.Native/src/OSX/WindowBaseImpl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -566,11 +566,6 @@
}
}

void WindowBaseImpl::OnInitialiseNSWindow()
{

}

void WindowBaseImpl::InitialiseNSWindow() {
if(Window != nullptr) {
[Window setContentView:StandardContainer];
Expand All @@ -593,8 +588,6 @@
[GetWindowProtocol() showWindowMenuWithAppMenu];
}
}

OnInitialiseNSWindow();
}
}

Expand Down
3 changes: 1 addition & 2 deletions native/Avalonia.Native/src/OSX/WindowImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ BEGIN_INTERFACE_MAP()

virtual bool IsDialog() override;

virtual void OnInitialiseNSWindow() override;

virtual void BringToFront () override;

bool CanBecomeKeyWindow ();
Expand All @@ -103,6 +101,7 @@ BEGIN_INTERFACE_MAP()
virtual NSWindowStyleMask GetStyle() override;

private:
void OnInitialiseNSWindow();
NSString *_lastTitle;
};

Expand Down
3 changes: 3 additions & 0 deletions native/Avalonia.Native/src/OSX/WindowImpl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
_lastTitle = @"";
_parent = nullptr;
WindowEvents = events;

OnInitialiseNSWindow();
}

void WindowImpl::HideOrShowTrafficLights() {
Expand All @@ -40,6 +42,7 @@

void WindowImpl::OnInitialiseNSWindow(){
[GetWindowProtocol() setCanBecomeKeyWindow:true];

[Window disableCursorRects];
[Window setTabbingMode:NSWindowTabbingModeDisallowed];
[Window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
Expand Down

0 comments on commit 8499a55

Please sign in to comment.