From e92a14ac5fa8e4fea3254e87b3449302bed3e6dd 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 92f40588f23..fb42f71a75f 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -478,6 +478,14 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph I = args.front(); 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();