Ver código fonte

Ignore process serial number (`-psn_...`) command line argument passed by macOS Gatekeeper.

(cherry picked from commit e92a14ac5fa8e4fea3254e87b3449302bed3e6dd)
bruvzg 5 anos atrás
pai
commit
acfd8b67bd
1 arquivos alterados com 8 adições e 0 exclusões
  1. 8 0
      main/main.cpp

+ 8 - 0
main/main.cpp

@@ -427,6 +427,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<String>::Element *N = I->next();