diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-17 11:57:50 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-17 11:57:50 +0100 |
commit | 921ab252e7b368a7696bcb783a405c5b53ea42bf (patch) | |
tree | 77f2a44b5fd3b2a9f7d412725d7b95a1e4633806 | |
parent | 90ba2d270b97a0cd940166d96272d15f51fd5c04 (diff) | |
parent | 153d06d79b3a1411a632e7df778369bc170d16e0 (diff) |
Merge pull request #68777 from bruvzg/mac_activ_13
[macOS] Update activation hack to work on Ventura.
-rw-r--r-- | platform/macos/godot_application_delegate.mm | 4 |
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]; } |