From: mozilla-central Subject: make it possible to define MOZILLA_APP_LAUNCHER to control which app should be used for session management References: https://bugzilla.mozilla.org/show_bug.cgi?id=453689 --- mozilla-1.9.1/toolkit/xre/nsNativeAppSupportUnix.cpp 2009-04-27 09:23:29.000000000 +0200 +++ mozilla-central/toolkit/xre/nsNativeAppSupportUnix.cpp 2009-07-07 12:55:10.000000000 +0200 @@ -155,31 +155,37 @@ gboolean save_yourself_cb(GnomeClient *c interact_cb, nsnull); return TRUE; } - - // Tell GNOME the command for restarting us so that we can be part of XSMP session restore - NS_ASSERTION(gDirServiceProvider, "gDirServiceProvider is NULL! This shouldn't happen!"); - nsCOMPtr executablePath; - nsresult rv; - - PRBool dummy; - rv = gDirServiceProvider->GetFile(XRE_EXECUTABLE_FILE, &dummy, getter_AddRefs(executablePath)); - - if (NS_SUCCEEDED(rv)) { - nsCAutoString path; - char* argv[1]; - - // Strip off the -bin suffix to get the shell script we should run; this is what Breakpad does - nsCAutoString leafName; - rv = executablePath->GetNativeLeafName(leafName); - if (NS_SUCCEEDED(rv) && StringEndsWith(leafName, NS_LITERAL_CSTRING("-bin"))) { - leafName.SetLength(leafName.Length() - strlen("-bin")); - executablePath->SetNativeLeafName(leafName); + + // Is there a request to suppress default binary launcher? + char* argv1 = getenv("MOZ_APP_LAUNCHER"); + + if(!argv1) { + // Tell GNOME the command for restarting us so that we can be part of XSMP session restore + NS_ASSERTION(gDirServiceProvider, "gDirServiceProvider is NULL! This shouldn't happen!"); + nsCOMPtr executablePath; + nsresult rv; + + PRBool dummy; + rv = gDirServiceProvider->GetFile(XRE_EXECUTABLE_FILE, &dummy, getter_AddRefs(executablePath)); + + if (NS_SUCCEEDED(rv)) { + nsCAutoString path; + + // Strip off the -bin suffix to get the shell script we should run; this is what Breakpad does + nsCAutoString leafName; + rv = executablePath->GetNativeLeafName(leafName); + if (NS_SUCCEEDED(rv) && StringEndsWith(leafName, NS_LITERAL_CSTRING("-bin"))) { + leafName.SetLength(leafName.Length() - strlen("-bin")); + executablePath->SetNativeLeafName(leafName); + } + + executablePath->GetNativePath(path); + argv1 = (char*)(path.get()); } + } - executablePath->GetNativePath(path); - argv[0] = (char*)(path.get()); - - gnome_client_set_restart_command(client, 1, argv); + if(argv1) { + gnome_client_set_restart_command(client, 1, &argv1); } return TRUE;