Skip to content

Commit dedb2ff

Browse files
committed
Merge pull request godotengine#97678 from bruvzg/fix_nd_menu
[macOS] Fix menu crash when used from opened native dialog.
2 parents 6d9a797 + 4c8f8e6 commit dedb2ff

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

platform/macos/godot_menu_delegate.mm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,11 @@ - (BOOL)menuHasKeyEquivalent:(NSMenu *)menu forEvent:(NSEvent *)event target:(id
102102
} else {
103103
// Otherwise redirect event to the engine.
104104
if (DisplayServer::get_singleton()) {
105-
[[[NSApplication sharedApplication] keyWindow] sendEvent:event];
105+
if ([[NSApplication sharedApplication] keyWindow].sheet) {
106+
[[[[NSApplication sharedApplication] keyWindow] sheetParent] sendEvent:event];
107+
} else {
108+
[[[NSApplication sharedApplication] keyWindow] sendEvent:event];
109+
}
106110
}
107111
}
108112

0 commit comments

Comments
 (0)