Skip to content

Commit 136a0ab

Browse files
committed
Merge pull request AvaloniaUI#10431 from AvaloniaUI/fixes/osx-menu-reparenting-crash
if the window is closed, we cannot become the key window.
1 parent 8096b59 commit 136a0ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

native/Avalonia.Native/src/OSX/AvnWindow.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ - (NSRect)windowWillUseStandardFrame:(NSWindow*)window
237237

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

0 commit comments

Comments
 (0)