Sfoglia il codice sorgente

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

bruvzg 5 anni fa
parent
commit
457dc5056d
1 ha cambiato i file con 8 aggiunte e 0 eliminazioni
  1. 8 0
      main/main.cpp

+ 8 - 0
main/main.cpp

@@ -286,6 +286,14 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
 #endif
 #endif
 
 
 	while (I) {
 	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();
 		List<String>::Element *N = I->next();