Bug 898002 - Ignore synthesized touch events. r=marcoz

This commit is contained in:
Eitan Isaacson 2013-07-25 10:09:48 -07:00
parent 16d39e2738
commit 0c4cc83442

View File

@ -42,6 +42,9 @@ this.TouchAdapter = {
// The virtual touch ID generated by a mouse event.
MOUSE_ID: 'mouse',
// Synthesized touch ID.
SYNTH_ID: -1,
start: function TouchAdapter_start() {
Logger.info('TouchAdapter.start');
@ -131,6 +134,13 @@ this.TouchAdapter = {
return;
}
let changedTouches = aEvent.changedTouches || [aEvent];
if (changedTouches.length == 1 &&
changedTouches[0].identifier == this.SYNTH_ID) {
return;
}
if (!this.eventsOfInterest[aEvent.type]) {
aEvent.preventDefault();
aEvent.stopImmediatePropagation();
@ -142,8 +152,6 @@ this.TouchAdapter = {
delete this._delayedEvent;
}
let changedTouches = aEvent.changedTouches || [aEvent];
// XXX: Until bug 77992 is resolved, on desktop we get microseconds
// instead of milliseconds.
let timeStamp = (Utils.OS == 'Android') ? aEvent.timeStamp : Date.now();