Bug 652120 - Grippy missing from Classic theme menubar on GTK2 plus sync to toolkit's toolbar binding r=neil
--- 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 {