summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2022-07-07 10:57:22 +0300
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2022-07-07 12:11:31 +0300
commit238ac2fdd5e9d93f51a32d9341c5b70eb66bb491 (patch)
tree3fae36eda29ef52d5c8d3fd27c3d957c55e45153 /main
parent8ec6c075bd38620358c1cadafa1a515a5711695a (diff)
[macOS] Improve file association handling, and allow URL schema handling.
Diffstat (limited to 'main')
-rw-r--r--main/main.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/main/main.cpp b/main/main.cpp
index f7c192001b..eb401cd9ef 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -621,11 +621,18 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
/* argument parsing and main creation */
List<String> args;
List<String> main_args;
+ List<String> platform_args = OS::get_singleton()->get_cmdline_platform_args();
+ // Add command line arguments.
for (int i = 0; i < argc; i++) {
args.push_back(String::utf8(argv[i]));
}
+ // Add arguments received from macOS LaunchService (URL schemas, file associations).
+ for (const String &arg : platform_args) {
+ args.push_back(arg);
+ }
+
List<String>::Element *I = args.front();
while (I) {