forked from pool/MozillaFirefox
a7f369b4c2
* MFSA 2012-34/CVE-2012-1938/CVE-2012-1937/CVE-2011-3101 Miscellaneous memory safety hazards * MFSA 2012-36/CVE-2012-1944 (bmo#751422) Content Security Policy inline-script bypass * MFSA 2012-37/CVE-2012-1945 (bmo#670514) Information disclosure though Windows file shares and shortcut files * MFSA 2012-38/CVE-2012-1946 (bmo#750109) Use-after-free while replacing/inserting a node in a document * MFSA 2012-40/CVE-2012-1947/CVE-2012-1940/CVE-2012-1941 Buffer overflow and use-after-free issues found using Address Sanitizer - require NSS 3.13.4 * MFSA 2012-39/CVE-2012-0441 (bmo#715073) - fix sound notifications when filename/path contains a whitespace (bmo#749739) OBS-URL: https://build.opensuse.org/package/show/mozilla:Factory/MozillaFirefox?expand=0&rev=280
92 lines
3.5 KiB
Diff
92 lines
3.5 KiB
Diff
# HG changeset patch
|
|
# Parent fd2da289a3c15b8c96c248df2710d879793f22c9
|
|
# User Wolfgang Rosenauer <wr@rosenauer.org>
|
|
Bug 526717 - remove non-working "Set as desktop background" from the UI for unsupported desktops
|
|
|
|
diff --git a/browser/base/content/nsContextMenu.js b/browser/base/content/nsContextMenu.js
|
|
--- a/browser/base/content/nsContextMenu.js
|
|
+++ b/browser/base/content/nsContextMenu.js
|
|
@@ -262,17 +262,17 @@ nsContextMenu.prototype = {
|
|
|
|
// Set as Desktop background depends on whether an image was clicked on,
|
|
// and only works if we have a shell service.
|
|
var haveSetDesktopBackground = false;
|
|
#ifdef HAVE_SHELL_SERVICE
|
|
// Only enable Set as Desktop Background if we can get the shell service.
|
|
var shell = getShellService();
|
|
if (shell)
|
|
- haveSetDesktopBackground = true;
|
|
+ haveSetDesktopBackground = shell.canSetDesktopBackground;
|
|
#endif
|
|
this.showItem("context-setDesktopBackground",
|
|
haveSetDesktopBackground && this.onLoadedImage);
|
|
|
|
if (haveSetDesktopBackground && this.onLoadedImage) {
|
|
document.getElementById("context-setDesktopBackground")
|
|
.disabled = this.disableSetDesktopBackground();
|
|
}
|
|
diff --git a/browser/components/shell/public/nsIShellService.idl b/browser/components/shell/public/nsIShellService.idl
|
|
--- a/browser/components/shell/public/nsIShellService.idl
|
|
+++ b/browser/components/shell/public/nsIShellService.idl
|
|
@@ -69,16 +69,25 @@ interface nsIShellService : nsISupports
|
|
/**
|
|
* Used to determine whether or not to show a "Set Default Browser"
|
|
* query dialog. This attribute is true if the application is starting
|
|
* up and "browser.shell.checkDefaultBrowser" is true, otherwise it
|
|
* is false.
|
|
*/
|
|
attribute boolean shouldCheckDefaultBrowser;
|
|
|
|
+ /**
|
|
+ * Used to determine whether or not to offer "Set as desktop background"
|
|
+ * context menu item. Even if shell service is available it is not
|
|
+ * guaranteed that it is able to set the background for every desktop
|
|
+ * which is especially true for Linux with its many different desktop
|
|
+ * environments.
|
|
+ */
|
|
+ readonly attribute boolean canSetDesktopBackground;
|
|
+
|
|
/**
|
|
* Flags for positioning/sizing of the Desktop Background image.
|
|
*/
|
|
const long BACKGROUND_TILE = 1;
|
|
const long BACKGROUND_STRETCH = 2;
|
|
const long BACKGROUND_CENTER = 3;
|
|
const long BACKGROUND_FILL = 4;
|
|
const long BACKGROUND_FIT = 5;
|
|
diff --git a/browser/components/shell/src/nsGNOMEShellService.cpp b/browser/components/shell/src/nsGNOMEShellService.cpp
|
|
--- a/browser/components/shell/src/nsGNOMEShellService.cpp
|
|
+++ b/browser/components/shell/src/nsGNOMEShellService.cpp
|
|
@@ -377,16 +377,31 @@ nsGNOMEShellService::SetShouldCheckDefau
|
|
pserve->GetBranch("", getter_AddRefs(prefs));
|
|
|
|
if (prefs)
|
|
prefs->SetBoolPref(PREF_CHECKDEFAULTBROWSER, aShouldCheck);
|
|
|
|
return NS_OK;
|
|
}
|
|
|
|
+NS_IMETHODIMP
|
|
+nsGNOMEShellService::GetCanSetDesktopBackground(bool* aResult)
|
|
+{
|
|
+ // setting desktop background is currently only supported
|
|
+ // for Gnome or desktops using the same GSettings and GConf keys
|
|
+ const char* gnomeSession = getenv("GNOME_DESKTOP_SESSION_ID");
|
|
+ if (gnomeSession) {
|
|
+ *aResult = true;
|
|
+ } else {
|
|
+ *aResult = false;
|
|
+ }
|
|
+
|
|
+ return NS_OK;
|
|
+}
|
|
+
|
|
static nsresult
|
|
WriteImage(const nsCString& aPath, imgIContainer* aImage)
|
|
{
|
|
#ifndef MOZ_WIDGET_GTK2
|
|
return NS_ERROR_NOT_AVAILABLE;
|
|
#else
|
|
nsCOMPtr<nsIImageToPixbuf> imgToPixbuf =
|
|
do_GetService("@mozilla.org/widget/image-to-gdk-pixbuf;1");
|