From 4c8f8e69805ce05ff2b7d0ca09de1566e889ad52 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Tue, 1 Oct 2024 08:30:30 +0300 Subject: [PATCH] [macOS] Fix menu crash when used from opened native dialog. --- platform/macos/godot_menu_delegate.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/platform/macos/godot_menu_delegate.mm b/platform/macos/godot_menu_delegate.mm index 3f7dfac3dec..16fdd0d189a 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]; + } } }