Bug 481517: While panning, mouse out of desktop window doesn't stop, r=mfinkle

This commit is contained in:
Ben Combee 2009-03-04 18:50:43 -05:00
Родитель 04870cd6ba
Коммит eed06e1023
1 изменённых файлов: 13 добавлений и 6 удалений

Просмотреть файл

@ -76,11 +76,14 @@ function getScrollboxFromElement(elem) {
*/ */
function InputHandler() { function InputHandler() {
/* used to stop everything if mouse leaves window on desktop */
window.addEventListener("mouseout", this, true);
let stack = document.getElementById("browser-container"); let stack = document.getElementById("browser-container");
stack.addEventListener("DOMMouseScroll", this, true); stack.addEventListener("DOMMouseScroll", this, true);
/* these handle dragging of both chrome elements and content */ /* these handle dragging of both chrome elements and content */
stack.addEventListener("mouseout", this, true); //stack.addEventListener("mouseout", this, true);
stack.addEventListener("mousedown", this, true); stack.addEventListener("mousedown", this, true);
stack.addEventListener("mouseup", this, true); stack.addEventListener("mouseup", this, true);
stack.addEventListener("mousemove", this, true); stack.addEventListener("mousemove", this, true);
@ -117,8 +120,6 @@ InputHandler.prototype = {
ungrab: function ungrab(obj) { ungrab: function ungrab(obj) {
this._grabbed = null; this._grabbed = null;
// only send events to this object
// call cancel on all modules
}, },
startListening: function startListening() { startListening: function startListening() {
@ -133,6 +134,15 @@ InputHandler.prototype = {
if (this._ignoreEvents) if (this._ignoreEvents)
return; return;
// relatedTarget should only be NULL if we move out of window
// if so, ungrab and reset everything. We don't always get
// mouseout events if the mouse movement causes other window
// activity, but this catches many of the cases
if (aEvent.type == "mouseout" && !aEvent.relatedTarget) {
this.grab(null);
return;
}
if (this._grabbed) { if (this._grabbed) {
this._grabbed.handleEvent(aEvent); this._grabbed.handleEvent(aEvent);
} }
@ -708,9 +718,6 @@ ContentClickingModule.prototype = {
this._sendDoubleClick(); this._sendDoubleClick();
} }
break; break;
case "mouseout":
this._reset();
break;
} }
}, },