mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-18 14:56:07 +00:00
Bug 844326 - Use addSystemEventListener to receive all mouse/touch events. r=vingtetun
This commit is contained in:
parent
8fcaceed5f
commit
07a1fafd59
@ -13,6 +13,8 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/Geometry.jsm");
|
||||
|
||||
var global = this;
|
||||
|
||||
const ContentPanning = {
|
||||
// Are we listening to touch or mouse events?
|
||||
watchedEventsType: '',
|
||||
@ -42,8 +44,16 @@ const ContentPanning = {
|
||||
events = ['mousedown', 'mouseup', 'mousemove'];
|
||||
this.watchedEventsType = 'mouse';
|
||||
}
|
||||
|
||||
let els = Cc["@mozilla.org/eventlistenerservice;1"]
|
||||
.getService(Ci.nsIEventListenerService);
|
||||
|
||||
events.forEach(function(type) {
|
||||
addEventListener(type, this, false);
|
||||
// Using the system group for mouse/touch events to avoid
|
||||
// missing events if .stopPropagation() has been called.
|
||||
els.addSystemEventListener(global, type,
|
||||
this.handleEvent.bind(this),
|
||||
/* useCapture = */ false);
|
||||
}.bind(this));
|
||||
|
||||
addMessageListener("Viewport:Change", this._recvViewportChange.bind(this));
|
||||
|
Loading…
x
Reference in New Issue
Block a user