1 From: Wolfgang Rosenauer
2 NonGnome/KDE integration
5 https://bugzilla.novell.com/show_bug.cgi?id=170055
7 diff --git a/browser/base/content/nsContextMenu.js b/browser/base/content/nsContextMenu.js
8 --- a/browser/base/content/nsContextMenu.js
9 +++ b/browser/base/content/nsContextMenu.js
10 @@ -237,17 +237,19 @@ nsContextMenu.prototype = {
11 this.showItem("context-sep-viewsource", shouldShow);
13 // Set as Desktop background depends on whether an image was clicked on,
14 // and only works if we have a shell service.
15 var haveSetDesktopBackground = false;
16 #ifdef HAVE_SHELL_SERVICE
17 // Only enable Set as Desktop Background if we can get the shell service.
18 var shell = getShellService();
20 + var env = Components.classes["@mozilla.org/process/environment;1"]
21 + .getService(Components.interfaces.nsIEnvironment);
22 + if (shell && env.get('DESKTOP_SESSION') == "gnome")
23 haveSetDesktopBackground = true;
25 this.showItem("context-setDesktopBackground",
26 haveSetDesktopBackground && this.onLoadedImage);
28 if (haveSetDesktopBackground && this.onLoadedImage) {
29 document.getElementById("context-setDesktopBackground")
30 .disabled = this.disableSetDesktopBackground();