[vlc-devel] commit: macosx: Properly relaunch VLC when asked for. (Pierre d'Herbemont )

git version control git at videolan.org
Tue Sep 16 15:28:03 CEST 2008


vlc | branch: 0.9-bugfix | Pierre d'Herbemont <pdherbemont at videolan.org> | Tue Sep 16 09:35:09 2008 +0200| [1bfb4432a349d446a9f40e55b623817f439c73d6] | committer: Felix Paul Kühne 

macosx: Properly relaunch VLC when asked for.

Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1bfb4432a349d446a9f40e55b623817f439c73d6
---

 modules/gui/macosx/intf.m |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index fd2fbec..e983c85 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -31,6 +31,7 @@
 #include <sys/param.h>                                    /* for MAXPATHLEN */
 #include <string.h>
 #include <vlc_keys.h>
+#include <spawn.h>
 
 #ifdef HAVE_CONFIG_H
 #   include "config.h"
@@ -2258,7 +2259,11 @@ end:
     [[NSUserDefaults standardUserDefaults] setInteger:kCurrentPreferencesVersion forKey:kVLCPreferencesVersion];
 
     /* Relaunch now */
-    [[NSWorkspace sharedWorkspace] launchApplication:[[NSBundle mainBundle] bundlePath]];
+    const char * path = [[[NSBundle mainBundle] executablePath] UTF8String];
+    const char *spawnedArgs[2] = { path, NULL };
+    char *spawnedEnv[] = {NULL};
+
+    posix_spawn(NULL, path, NULL, NULL, spawnedArgs, spawnedEnv);
     exit(0);
 }
 




More information about the vlc-devel mailing list