[macOS] Fix menu crash when used from opened native dialog.

This commit is contained in:
bruvzg 2024-10-01 08:30:30 +03:00
parent e3213aaef5
commit 4c8f8e6980
No known key found for this signature in database
GPG Key ID: 7960FCF39844EC38

View File

@ -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];
}
}
}