mirror of
https://github.com/godotengine/godot.git
synced 2025-01-30 21:33:18 +08:00
[macOS] Update activation hack to work on Ventura.
This commit is contained in:
parent
966785751f
commit
153d06d79b
@ -61,7 +61,9 @@
|
|||||||
|
|
||||||
- (void)applicationDidFinishLaunching:(NSNotification *)notice {
|
- (void)applicationDidFinishLaunching:(NSNotification *)notice {
|
||||||
NSString *nsappname = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"];
|
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).
|
// 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];
|
[self performSelector:@selector(forceUnbundledWindowActivationHackStep1) withObject:nil afterDelay:0.02];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user