https://bugzilla.mozilla.org/show_bug.cgi?id=420408 https://bugs.launchpad.net/ubuntu/+bug/196493 --- browser/components/shell/src/nsGNOMEShellService.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) Index: mozilla/browser/components/shell/src/nsGNOMEShellService.cpp =================================================================== --- mozilla.orig/browser/components/shell/src/nsGNOMEShellService.cpp +++ mozilla/browser/components/shell/src/nsGNOMEShellService.cpp @@ -62,16 +62,18 @@ #endif #include #include #include #include #include +#define SYSTEM_PATH_BUILD 1 + struct ProtocolAssociation { const char *name; PRBool essential; }; struct MimeTypeAssociation { @@ -135,17 +137,16 @@ return appPath->GetNativePath(mAppPath); } NS_IMPL_ISUPPORTS1(nsGNOMEShellService, nsIShellService) PRBool nsGNOMEShellService::KeyMatchesAppName(const char *aKeyValue) const { - gchar *commandPath; if (mUseLocaleFilenames) { gchar *nativePath = g_filename_from_utf8(aKeyValue, -1, NULL, NULL, NULL); if (!nativePath) { NS_ERROR("Error converting path to filesystem encoding"); return PR_FALSE; } @@ -153,19 +154,25 @@ g_free(nativePath); } else { commandPath = g_find_program_in_path(aKeyValue); } if (!commandPath) return PR_FALSE; +#ifdef SYSTEM_PATH_BUILD + PRBool matches = NS_LITERAL_CSTRING("/usr/bin/" MOZ_APP_NAME).Equals(commandPath); + g_free(commandPath); + return matches; +#else PRBool matches = mAppPath.Equals(commandPath); g_free(commandPath); return matches; +#endif } NS_IMETHODIMP nsGNOMEShellService::IsDefaultBrowser(PRBool aStartupCheck, PRBool* aIsDefaultBrowser) { *aIsDefaultBrowser = PR_FALSE; if (aStartupCheck) @@ -211,18 +218,23 @@ #ifdef DEBUG if (aForAllUsers) NS_WARNING("Setting the default browser for all users is not yet supported"); #endif nsCOMPtr gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID); nsCAutoString schemeList; + +#ifdef SYSTEM_PATH_BUILD + nsCAutoString appKeyValue(NS_LITERAL_CSTRING("/usr/bin/" MOZ_APP_NAME)); +#else nsCAutoString appKeyValue(mAppPath); - appKeyValue.Append(" \"%s\""); +#endif + appKeyValue.Append(" %s"); unsigned int i; for (i = 0; i < NS_ARRAY_LENGTH(appProtocols); ++i) { schemeList.Append(nsDependentCString(appProtocols[i].name)); schemeList.Append(','); if (appProtocols[i].essential || aClaimAllTypes) { gconf->SetAppForProtocol(nsDependentCString(appProtocols[i].name),