firefox-cross-desktop.patch
author Wolfgang Rosenauer <wr@rosenauer.org>
Thu, 15 Mar 2012 10:33:22 +0100
changeset 409 ff30593d2daa
parent 223 4555a5d0d661
child 419 f6b055dd94bc
permissions -rw-r--r--
switch to 12.0dev
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     1
From: Wolfgang Rosenauer
223
4555a5d0d661 patch reorganization
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 0
diff changeset
     2
NonGnome/KDE integration
4555a5d0d661 patch reorganization
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 0
diff changeset
     3
0
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     4
References:
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     5
https://bugzilla.novell.com/show_bug.cgi?id=170055
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     6
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     7
diff --git a/browser/base/content/nsContextMenu.js b/browser/base/content/nsContextMenu.js
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     8
--- a/browser/base/content/nsContextMenu.js
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     9
+++ b/browser/base/content/nsContextMenu.js
223
4555a5d0d661 patch reorganization
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 0
diff changeset
    10
@@ -237,17 +237,19 @@ nsContextMenu.prototype = {
4555a5d0d661 patch reorganization
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 0
diff changeset
    11
     this.showItem("context-sep-viewsource", shouldShow);
4555a5d0d661 patch reorganization
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 0
diff changeset
    12
 
0
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    13
     // Set as Desktop background depends on whether an image was clicked on,
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    14
     // and only works if we have a shell service.
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    15
     var haveSetDesktopBackground = false;
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    16
 #ifdef HAVE_SHELL_SERVICE
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    17
     // Only enable Set as Desktop Background if we can get the shell service.
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    18
     var shell = getShellService();
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    19
-    if (shell)
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    20
+    var env = Components.classes["@mozilla.org/process/environment;1"]
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    21
+                        .getService(Components.interfaces.nsIEnvironment);
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    22
+    if (shell && env.get('DESKTOP_SESSION') == "gnome")
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    23
       haveSetDesktopBackground = true;
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    24
 #endif
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    25
     this.showItem("context-setDesktopBackground",
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    26
                   haveSetDesktopBackground && this.onLoadedImage);
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    27
 
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    28
     if (haveSetDesktopBackground && this.onLoadedImage) {
223
4555a5d0d661 patch reorganization
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 0
diff changeset
    29
       document.getElementById("context-setDesktopBackground")
4555a5d0d661 patch reorganization
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 0
diff changeset
    30
               .disabled = this.disableSetDesktopBackground();