summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-10-04 11:21:54 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-10-04 11:21:54 +0200
commitdedb2ff21772c27add308b4bfbf5baeddd97de6f (patch)
tree1c822b68a253493bd35aba45f5d445eae9d7dd77
parent6d9a797ea48e521bf8a7bba1b4b3b1924c77ab6f (diff)
parent4c8f8e69805ce05ff2b7d0ca09de1566e889ad52 (diff)
downloadredot-engine-dedb2ff21772c27add308b4bfbf5baeddd97de6f.tar.gz
Merge pull request #97678 from bruvzg/fix_nd_menu
[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];
+ }
}
}