aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamian Minkov <damencho@jitsi.org>2013-11-07 15:35:08 +0200
committerDamian Minkov <damencho@jitsi.org>2013-11-07 15:35:08 +0200
commit100ffddbcd0854b97e5b5e4946e35e163f2014d3 (patch)
treee4591a16b92fe513c8c786c1fc9571361d5aa1c3
parente8caf7d590a6a63ab286e323169c45f8330cadbd (diff)
downloadjitsi-100ffddbcd0854b97e5b5e4946e35e163f2014d3.zip
jitsi-100ffddbcd0854b97e5b5e4946e35e163f2014d3.tar.gz
jitsi-100ffddbcd0854b97e5b5e4946e35e163f2014d3.tar.bz2
Updates macosx launcher to skip -psn parameters as they prevents the application from starting.
-rwxr-xr-xresources/install/macosx/JavaApplicationStubbin47180 -> 47180 bytes
-rw-r--r--src/native/macosx/launcher/launcher.m21
2 files changed, 18 insertions, 3 deletions
diff --git a/resources/install/macosx/JavaApplicationStub b/resources/install/macosx/JavaApplicationStub
index dd4686f..25a52e6 100755
--- a/resources/install/macosx/JavaApplicationStub
+++ b/resources/install/macosx/JavaApplicationStub
Binary files differ
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,