mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 785076 - Work around touch emulation timestamp issue. r=davidb
This commit is contained in:
parent
1c81138c6c
commit
e3da1bafe4
@ -85,38 +85,41 @@ var TouchAdapter = {
|
||||
|
||||
handleEvent: function TouchAdapter_handleEvent(aEvent) {
|
||||
let touches = aEvent.changedTouches;
|
||||
// XXX: Until bug 77992 is resolved, on desktop we get microseconds
|
||||
// instead of milliseconds.
|
||||
let timeStamp = (Utils.OS == 'Android') ? aEvent.timeStamp : Date.now();
|
||||
switch (aEvent.type) {
|
||||
case 'touchstart':
|
||||
for (var i = 0; i < touches.length; i++) {
|
||||
let touch = touches[i];
|
||||
let touchPoint = new TouchPoint(touch, aEvent.timeStamp, this._dpi);
|
||||
let touchPoint = new TouchPoint(touch, timeStamp, this._dpi);
|
||||
this._touchPoints[touch.identifier] = touchPoint;
|
||||
this._lastExploreTime = aEvent.timeStamp + this.SWIPE_MAX_DURATION;
|
||||
this._lastExploreTime = timeStamp + this.SWIPE_MAX_DURATION;
|
||||
}
|
||||
this._dwellTimeout = this.chromeWin.setTimeout(
|
||||
(function () {
|
||||
this.compileAndEmit(aEvent.timeStamp + this.DWELL_THRESHOLD);
|
||||
this.compileAndEmit(timeStamp + this.DWELL_THRESHOLD);
|
||||
}).bind(this), this.DWELL_THRESHOLD);
|
||||
break;
|
||||
case 'touchmove':
|
||||
for (var i = 0; i < touches.length; i++) {
|
||||
let touch = touches[i];
|
||||
let touchPoint = this._touchPoints[touch.identifier];
|
||||
touchPoint.update(touch, aEvent.timeStamp);
|
||||
touchPoint.update(touch, timeStamp);
|
||||
}
|
||||
if (aEvent.timeStamp - this._lastExploreTime >= EXPLORE_THROTTLE) {
|
||||
this.compileAndEmit(aEvent.timeStamp);
|
||||
this._lastExploreTime = aEvent.timeStamp;
|
||||
if (timeStamp - this._lastExploreTime >= EXPLORE_THROTTLE) {
|
||||
this.compileAndEmit(timeStamp);
|
||||
this._lastExploreTime = timeStamp;
|
||||
}
|
||||
break;
|
||||
case 'touchend':
|
||||
for (var i = 0; i < touches.length; i++) {
|
||||
let touch = touches[i];
|
||||
let touchPoint = this._touchPoints[touch.identifier];
|
||||
touchPoint.update(touch, aEvent.timeStamp);
|
||||
touchPoint.update(touch, timeStamp);
|
||||
touchPoint.finish();
|
||||
}
|
||||
this.compileAndEmit(aEvent.timeStamp);
|
||||
this.compileAndEmit(timeStamp);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user