Skip to content

Commit

Permalink
Merge pull request #68777 from bruvzg/mac_activ_13
Browse files Browse the repository at this point in the history
[macOS] Update activation hack to work on Ventura.
  • Loading branch information
akien-mga committed Nov 17, 2022
2 parents 90ba2d2 + 153d06d commit 921ab25
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion platform/macos/godot_application_delegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ - (void)forceUnbundledWindowActivationHackStep3 {

- (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];
}
Expand Down

0 comments on commit 921ab25

Please sign in to comment.