Bug 652120 - Grippy missing from Classic theme menubar on GTK2 plus sync to toolkit's toolbar binding r=neil
authorIan Neal <iann_cvs@blueyonder.co.uk>
Sat, 23 Apr 2011 10:13:04 +0100
changeset 7604 b066f8c46d19c96a153a96db4df3cd0dc3007593
parent 7603 cd22a42875a915305033197e05c03c4c593f1cd4
child 7605 52c2ccceb1d7508337afe4a593b904e5e70a2cca
push id5830
push useriann_cvs@blueyonder.co.uk
push dateSat, 23 Apr 2011 09:12:22 +0000
treeherdercomm-central@b066f8c46d19 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersneil
bugs652120
Bug 652120 - Grippy missing from Classic theme menubar on GTK2 plus sync to toolkit's toolbar binding r=neil
suite/common/bindings/toolbar.xml
suite/themes/classic/communicator/toolbar.css
--- a/suite/common/bindings/toolbar.xml
+++ b/suite/common/bindings/toolbar.xml
@@ -260,44 +260,56 @@
         </body>
       </method>
     </implementation>
   </binding>
 
   <binding id="grippytoolbar-drag"
            extends="chrome://communicator/content/bindings/toolbar.xml#grippytoolbar">
     <implementation>
+      <field name="_dragBindingAlive">true</field>
       <constructor>
         <![CDATA[
-          try {
-            Components.utils.import("resource://gre/modules/WindowDraggingUtils.jsm");
-            let draggableThis = new WindowDraggingElement(this, window);
-            draggableThis.mouseDownCheck = function(e) {
-            // Don't move while customizing or while in full screen mode.
-              return !(this.parentNode.customizing || window.fullScreen);
-            }
-          } catch (e) {}
+          if (!this._draggableStarted) {
+            this._draggableStarted = true;
+            try {
+              let tmp = {};
+              Components.utils.import("resource://gre/modules/WindowDraggingUtils.jsm", tmp);
+              let draggableThis = new tmp.WindowDraggingElement(this, window);
+              draggableThis.mouseDownCheck = function(e) {
+                // Don't move while customizing.
+                return this._dragBindingAlive &&
+                       this.getAttribute("customizing") != "true";
+              }
+            } catch (e) {}
+          }
         ]]>
       </constructor>
     </implementation>
   </binding>
 
   <binding id="grippytoolbar-primary-drag"
            extends="chrome://communicator/content/bindings/toolbar.xml#grippytoolbar-primary">
     <implementation>
+    <field name="_dragBindingAlive">true</field>
       <constructor>
         <![CDATA[
-          try {
-            Components.utils.import("resource://gre/modules/WindowDraggingUtils.jsm");
-            let draggableThis = new WindowDraggingElement(this, window);
-            draggableThis.mouseDownCheck = function(e) {
-            // Don't move while customizing or while in full screen mode.
-              return !(this.parentNode.customizing || window.fullScreen);
-            }
-          } catch (e) {}
+          if (!this._draggableStarted) {
+            this._draggableStarted = true;
+            try {
+              let tmp = {};
+              Components.utils.import("resource://gre/modules/WindowDraggingUtils.jsm", tmp);
+              let draggableThis = new tmp.WindowDraggingElement(this, window);
+              draggableThis.mouseDownCheck = function(e) {
+                // Don't move while customizing.
+                return this._dragBindingAlive &&
+                       this.getAttribute("customizing") != "true";
+              }
+            } catch (e) {}
+          }
         ]]>
       </constructor>
     </implementation>
   </binding>
 
   <binding id="grippytoolbar-menubar"
            extends="chrome://communicator/content/bindings/toolbar.xml#grippytoolbar"
            display="xul:menubar"/>
--- a/suite/themes/classic/communicator/toolbar.css
+++ b/suite/themes/classic/communicator/toolbar.css
@@ -38,16 +38,20 @@
  * ***** END LICENSE BLOCK ***** */
 
 /* ===== toolbar.css ====================================================
   == Styles used by XUL grippytoolbar in addition to general toolbar styles.
   ======================================================================= */
 
 @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
 
+toolbar[type="menubar"]:not([autohide="true"]):not([xpfe="false"]):not(:-moz-lwtheme):-moz-system-metric(menubar-drag) {
+  -moz-binding: url("chrome://communicator/content/bindings/toolbar.xml#grippytoolbar-drag");
+}
+
 /* ::::: toolbar & menubar ::::: */
 
 .toolbar-holder {
   border-left: 1px solid ThreeDHighlight;
 }
 
 toolbaritem > menubar,
 toolbar > menubar {