Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

[macOS] Force reset main menu on app activation.

Pāvels Nadtočajevs7f369cc0cc5b
diff --git a/platform/macos/godot_application.mm b/platform/macos/godot_application.mm
index 91e372697e3..f4643636da8 100644
--- a/platform/macos/godot_application.mm
+++ b/platform/macos/godot_application.mm
@@ -72,6 +72,15 @@ GodotApplication *GodotApp = nil;
[self performSelector:@selector(forceUnbundledWindowActivationHackStep1) withObject:nil afterDelay:0.02];
}
}
+ // Force reset main menu on macOS 27.
+ NSOperatingSystemVersion ver = [NSProcessInfo processInfo].operatingSystemVersion;
+ if (ver.majorVersion >= 27) {
+ NSMenu *main_menu = NSApp.mainMenu;
+ if (main_menu != nil) {
+ NSApp.mainMenu = nil;
+ NSApp.mainMenu = main_menu;
+ }
+ }
}
- (void)mediaKeyEvent:(int)key state:(BOOL)state repeat:(BOOL)repeat {