From 457dc5056d2a2a48db22997546c0f6240076b296 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Thu, 9 Apr 2020 20:06:43 +0300 Subject: [PATCH] Ignore process serial number (`-psn_...`) command line argument passed by macOS Gatekeeper. --- main/main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main/main.cpp b/main/main.cpp index b08fa12f9f..27fd0420ab 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -286,6 +286,14 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph #endif while (I) { +#ifdef OSX_ENABLED + // Ignore the process serial number argument passed by macOS Gatekeeper. + // Otherwise, Godot would try to open a non-existent project on the first start and abort. + if (I->get().begins_with("-psn_")) { + I = I->next(); + continue; + } +#endif List::Element *N = I->next();