summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2024-10-01 08:30:30 +0300
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2024-10-01 08:30:30 +0300
commit4c8f8e69805ce05ff2b7d0ca09de1566e889ad52 (patch)
treee32da99686575d56ee7b04f65e8c3b0e0e660b82
parente3213aaef5e0e72b8272e65d989d3d8222be17ca (diff)
downloadredot-engine-4c8f8e69805ce05ff2b7d0ca09de1566e889ad52.tar.gz
[macOS] Fix menu crash when used from opened native dialog.
-rw-r--r--platform/macos/godot_menu_delegate.mm6
1 files changed, 5 insertions, 1 deletions
diff --git a/platform/macos/godot_menu_delegate.mm b/platform/macos/godot_menu_delegate.mm
index 3f7dfac3de..16fdd0d189 100644
--- a/platform/macos/godot_menu_delegate.mm
+++ b/platform/macos/godot_menu_delegate.mm
@@ -102,7 +102,11 @@
} else {
// Otherwise redirect event to the engine.
if (DisplayServer::get_singleton()) {
- [[[NSApplication sharedApplication] keyWindow] sendEvent:event];
+ if ([[NSApplication sharedApplication] keyWindow].sheet) {
+ [[[[NSApplication sharedApplication] keyWindow] sheetParent] sendEvent:event];
+ } else {
+ [[[NSApplication sharedApplication] keyWindow] sendEvent:event];
+ }
}
}