0
|
1 |
From: Wolfgang Rosenauer
|
223
|
2 |
NonGnome/KDE integration
|
|
3 |
|
0
|
4 |
References:
|
|
5 |
https://bugzilla.novell.com/show_bug.cgi?id=170055
|
|
6 |
|
|
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
|
223
|
10 |
@@ -237,17 +237,19 @@ nsContextMenu.prototype = {
|
|
11 |
this.showItem("context-sep-viewsource", shouldShow);
|
|
12 |
|
0
|
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();
|
|
19 |
- if (shell)
|
|
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;
|
|
24 |
#endif
|
|
25 |
this.showItem("context-setDesktopBackground",
|
|
26 |
haveSetDesktopBackground && this.onLoadedImage);
|
|
27 |
|
|
28 |
if (haveSetDesktopBackground && this.onLoadedImage) {
|
223
|
29 |
document.getElementById("context-setDesktopBackground")
|
|
30 |
.disabled = this.disableSetDesktopBackground();
|