Skip to content

Commit

Permalink
Merge pull request AvaloniaUI#10431 from AvaloniaUI/fixes/osx-menu-re…
Browse files Browse the repository at this point in the history
…parenting-crash

if the window is closed, we cannot become the key window.
  • Loading branch information
grokys committed Feb 24, 2023
1 parent 8096b59 commit 136a0ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion native/Avalonia.Native/src/OSX/AvnWindow.mm
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ - (NSRect)windowWillUseStandardFrame:(NSWindow*)window

-(BOOL)canBecomeKeyWindow
{
if(_canBecomeKeyWindow)
if(_canBecomeKeyWindow && !_closed)
{
// If the window has a child window being shown as a dialog then don't allow it to become the key window.
auto parent = dynamic_cast<WindowImpl*>(_parent.getRaw());
Expand Down

0 comments on commit 136a0ab

Please sign in to comment.