Bug 598965 - Awesome screen can still be panned once the context menu is shown [r=mfinkle]
authorVivien Nicolas <21@vingtetun.org>
Thu, 23 Sep 2010 18:08:16 +0200
changeset 2054 5237ea6ffe6d68d81268606cb607c74bff8bcbd3
parent 2053 480783238d742b8ff2f0bfb343f68cf471f5eaaa
child 2055 afee6722441dbeee96ba0430d8a676e652ef32c7
push id1739
push uservnicolas@mozilla.com
push dateThu, 23 Sep 2010 16:08:30 +0000
reviewersmfinkle
bugs598965
Bug 598965 - Awesome screen can still be panned once the context menu is shown [r=mfinkle]
chrome/content/input.js
--- a/chrome/content/input.js
+++ b/chrome/content/input.js
@@ -105,27 +105,34 @@ function MouseModule(owner, browserViewC
                                         this._kineticStop.bind(this));
 
   this._singleClickTimeout = new Util.Timeout(this._doSingleClick.bind(this));
   this._longClickTimeout = new Util.Timeout(this._doLongClick.bind(this));
 
   window.addEventListener("mousedown", this, true);
   window.addEventListener("mouseup", this, true);
   window.addEventListener("mousemove", this, true);
+  window.addEventListener("contextmenu", this, false);
   window.addEventListener("CancelTouchSequence", this, true);
 }
 
 
 MouseModule.prototype = {
   handleEvent: function handleEvent(aEvent) {
     switch (aEvent.type) {
       case "MozBeforePaint":
         this._waitingForPaint = false;
         removeEventListener("MozBeforePaint", this, false);
         break;
+      case "contextmenu":
+        // bug 598965 - chrome UI should should stop to be pannable once the
+        // context menu has appeared
+        if (ContextHelper.popupState)
+          this.cancelPending();
+        break;
       case "CancelTouchSequence":
         this.cancelPending();
         break;
 
       default: {
         // Filter out mouse events that aren't first button
         if (aEvent.button !== 0)
           break;