diff --git a/platform/macos/display_server_macos.mm b/platform/macos/display_server_macos.mm index 966bc0d396a..72830c9e216 100644 --- a/platform/macos/display_server_macos.mm +++ b/platform/macos/display_server_macos.mm @@ -1860,7 +1860,6 @@ void DisplayServerMacOS::show_window(WindowID p_id) { WindowData &wd = windows[p_id]; if (p_id == MAIN_WINDOW_ID) { - [GodotApp setActivationPolicy:NSApplicationActivationPolicyRegular]; [GodotApp activateApplication]; } diff --git a/platform/macos/godot_main_macos.mm b/platform/macos/godot_main_macos.mm index e2f3d6955af..3807464fcf2 100644 --- a/platform/macos/godot_main_macos.mm +++ b/platform/macos/godot_main_macos.mm @@ -58,6 +58,21 @@ int main(int argc, char **argv) { bool is_embedded = false; bool is_headless = false; + const char *headless_args[] = { + "--headless", + "-h", + "--help", + "/?", + "--version", + "--dump-gdextension-interface", + "--dump-extension-api", + "--dump-extension-api-with-docs", + "--validate-extension-api", + "--convert-3to4", + "--validate-conversion-3to4", + "--doctool", + }; + for (int i = 0; i < argc; i++) { if (strcmp("-NSDocumentRevisionsDebugMode", argv[i]) == 0) { // remove "-NSDocumentRevisionsDebugMode" and the next argument @@ -76,9 +91,13 @@ int main(int argc, char **argv) { if (strcmp("--embedded", argv[i]) == 0) { is_embedded = true; } - if (strcmp("--headless", argv[i]) == 0 || strcmp("--doctool", argv[i]) == 0) { - is_headless = true; + for (size_t j = 0; j < std::size(headless_args); j++) { + if (strcmp(headless_args[j], argv[i]) == 0) { + is_headless = true; + break; + } } + if (i < argc - 1 && strcmp("--display-driver", argv[i]) == 0 && strcmp("headless", argv[i + 1]) == 0) { is_headless = true; } diff --git a/platform/macos/os_macos.mm b/platform/macos/os_macos.mm index 6a6eae96878..7756dba11d1 100644 --- a/platform/macos/os_macos.mm +++ b/platform/macos/os_macos.mm @@ -1153,7 +1153,7 @@ OS_MacOS_NSApp::OS_MacOS_NSApp(const char *p_execpath, int p_argc, char **p_argv [GodotApplication sharedApplication]; // In case we are unbundled, make us a proper UI application. - [NSApp setActivationPolicy:NSApplicationActivationPolicyAccessory]; + [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; // Menu bar setup must go between sharedApplication above and // finishLaunching below, in order to properly emulate the behavior