From f8299ebd3547acfed47e72ff8e3b58db597d00a3 Mon Sep 17 00:00:00 2001 From: Steve Fink Date: Wed, 24 Aug 2011 10:56:57 -0700 Subject: [PATCH] Bug 650078 - Make -no-remote not listen for remote commands when using X (r=bsmedberg) --HG-- extra : rebase_source : 580c0f00695db5f0d25f3afd78fa1a853d76d360 --- toolkit/xre/nsAppRunner.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index 1cb34594d1d..63333020429 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -3072,6 +3072,11 @@ XRE_main(int argc, char* argv[], const nsXREAppData* aAppData) #ifdef MOZ_ENABLE_XREMOTE // handle -remote now that xpcom is fired up + bool disableRemote = false; + { + char *e = PR_GetEnv("MOZ_NO_REMOTE"); + disableRemote = (e && *e); + } const char* xremotearg; ar = CheckArg("remote", PR_TRUE, &xremotearg); @@ -3085,7 +3090,7 @@ XRE_main(int argc, char* argv[], const nsXREAppData* aAppData) return HandleRemoteArgument(xremotearg, desktopStartupIDPtr); } - if (!PR_GetEnv("MOZ_NO_REMOTE")) { + if (!disableRemote) { // Try to remote the entire command line. If this fails, start up normally. RemoteResult rr = RemoteCommandLine(desktopStartupIDPtr); if (rr == REMOTE_FOUND) @@ -3527,7 +3532,8 @@ XRE_main(int argc, char* argv[], const nsXREAppData* aAppData) #ifdef MOZ_ENABLE_XREMOTE // if we have X remote support, start listening for requests on the // proxy window. - remoteService = do_GetService("@mozilla.org/toolkit/remote-service;1"); + if (!disableRemote) + remoteService = do_GetService("@mozilla.org/toolkit/remote-service;1"); if (remoteService) remoteService->Startup(gAppData->name, PromiseFlatCString(profileName).get());