diff options
author | Damian Minkov <damencho@jitsi.org> | 2013-11-07 15:35:08 +0200 |
---|---|---|
committer | Damian Minkov <damencho@jitsi.org> | 2013-11-07 15:35:08 +0200 |
commit | 100ffddbcd0854b97e5b5e4946e35e163f2014d3 (patch) | |
tree | e4591a16b92fe513c8c786c1fc9571361d5aa1c3 /src | |
parent | e8caf7d590a6a63ab286e323169c45f8330cadbd (diff) | |
download | jitsi-100ffddbcd0854b97e5b5e4946e35e163f2014d3.zip jitsi-100ffddbcd0854b97e5b5e4946e35e163f2014d3.tar.gz jitsi-100ffddbcd0854b97e5b5e4946e35e163f2014d3.tar.bz2 |
Updates macosx launcher to skip -psn parameters as they prevents the application from starting.
Diffstat (limited to 'src')
-rw-r--r-- | src/native/macosx/launcher/launcher.m | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/native/macosx/launcher/launcher.m b/src/native/macosx/launcher/launcher.m index baf756c..7c5b072 100644 --- a/src/native/macosx/launcher/launcher.m +++ b/src/native/macosx/launcher/launcher.m @@ -188,6 +188,15 @@ JLI_Launch_t getLauncher(NSDictionary *javaDictionary) void launchJitsi(int argMainCount, char *argMainValues[]) { + // special psn args that we will skip, + // those args are added when application is started from finder + int psnArgsCount = 0; + for(int i = 0; i < argMainCount; i++) + { + if(memcmp(argMainValues[i], "-psn_", 4) == 0) + psnArgsCount++; + } + NSBundle *mainBundle = [NSBundle mainBundle]; NSDictionary *infoDictionary = [mainBundle infoDictionary]; @@ -269,11 +278,11 @@ void launchJitsi(int argMainCount, char *argMainValues[]) appArgc = jargc; // Initialize the arguments to JLI_Launch() - int argc = 2 + [sprops count] + 1 + appArgc; + int argc = 2 + [sprops count] + 1 + appArgc - psnArgsCount; if(options != NULL) argc++; - char *argv[argc + appArgc]; + char *argv[argc]; int i = 0; argv[i++] = argMainValues[0]; @@ -308,10 +317,16 @@ void launchJitsi(int argMainCount, char *argMainValues[]) // the params are last in the array of arguments for(int j = appArgc; j > 0; j--) { - argv[i++] = strdup(argMainValues[argMainCount-j]); + // skip -psn args + if (memcmp(argMainValues[argMainCount-j], "-psn_", 4) != 0) + argv[i++] = strdup(argMainValues[argMainCount-j]); } argsSupplied++; + // once psn args are filtered, no more count them as they will not be + // supplied to the launch function + jargc = jargc - psnArgsCount; + // Invoke JLI_Launch() jli_LaunchFxnPtr(argc, argv, 0, NULL, |