summaryrefslogtreecommitdiff
path: root/platform/macos
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2022-11-17 11:14:03 +0200
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2022-11-17 11:14:03 +0200
commit153d06d79b3a1411a632e7df778369bc170d16e0 (patch)
treedc7a5d6ed6ec05ec31aed308fb1163576a079a2f /platform/macos
parent966785751f156c9b75be5aabf64bc52390c4b050 (diff)
[macOS] Update activation hack to work on Ventura.
Diffstat (limited to 'platform/macos')
-rw-r--r--platform/macos/godot_application_delegate.mm4
1 files changed, 3 insertions, 1 deletions
diff --git a/platform/macos/godot_application_delegate.mm b/platform/macos/godot_application_delegate.mm
index bacdcc2bc4..f1168c685a 100644
--- a/platform/macos/godot_application_delegate.mm
+++ b/platform/macos/godot_application_delegate.mm
@@ -61,7 +61,9 @@
- (void)applicationDidFinishLaunching:(NSNotification *)notice {
NSString *nsappname = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"];
- if (nsappname == nil || isatty(STDOUT_FILENO) || isatty(STDIN_FILENO) || isatty(STDERR_FILENO)) {
+ NSString *nsbundleid_env = [NSString stringWithUTF8String:getenv("__CFBundleIdentifier")];
+ NSString *nsbundleid = [[NSBundle mainBundle] bundleIdentifier];
+ if (nsappname == nil || isatty(STDOUT_FILENO) || isatty(STDIN_FILENO) || isatty(STDERR_FILENO) || ![nsbundleid isEqualToString:nsbundleid_env]) {
// If the executable is started from terminal or is not bundled, macOS WindowServer won't register and activate app window correctly (menu and title bar are grayed out and input ignored).
[self performSelector:@selector(forceUnbundledWindowActivationHackStep1) withObject:nil afterDelay:0.02];
}