зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1289435 - Ensure that the synthesized native touch events have sane timestamps. r=mstange
MozReview-Commit-ID: 6QxB7XBx7T7
This commit is contained in:
Родитель
6d50a6b8e2
Коммит
ebadfda552
|
@ -1208,8 +1208,9 @@ nsresult nsChildView::SynthesizeNativeTouchPoint(uint32_t aPointerId,
|
|||
|
||||
LayoutDeviceIntPoint pointInWindow = aPoint - WidgetToScreenOffset();
|
||||
MultiTouchInput inputToDispatch = UpdateSynthesizedTouchState(
|
||||
mSynthesizedTouchInput.get(), aPointerId, aPointerState,
|
||||
pointInWindow, aPointerPressure, aPointerOrientation);
|
||||
mSynthesizedTouchInput.get(), PR_IntervalNow(), TimeStamp::Now(),
|
||||
aPointerId, aPointerState, pointInWindow, aPointerPressure,
|
||||
aPointerOrientation);
|
||||
|
||||
if (mAPZC) {
|
||||
uint64_t inputBlockId = 0;
|
||||
|
|
|
@ -273,8 +273,13 @@ nsWindow::SynthesizeNativeTouchPoint(uint32_t aPointerId,
|
|||
mSynthesizedTouchInput = MakeUnique<MultiTouchInput>();
|
||||
}
|
||||
|
||||
// We should probably use a real timestamp here, but this is B2G and
|
||||
// so this probably never even exercised any more.
|
||||
uint32_t time = 0;
|
||||
TimeStamp timestamp = TimeStamp::FromSystemTime(time);
|
||||
|
||||
MultiTouchInput inputToDispatch = UpdateSynthesizedTouchState(
|
||||
mSynthesizedTouchInput.get(), aPointerId, aPointerState,
|
||||
mSynthesizedTouchInput.get(), time, timeStamp, aPointerId, aPointerState,
|
||||
aPoint, aPointerPressure, aPointerOrientation);
|
||||
|
||||
// Can't use NewRunnableMethod here because that will pass a const-ref
|
||||
|
|
|
@ -2073,6 +2073,8 @@ nsIWidget::ClearNativeTouchSequence(nsIObserver* aObserver)
|
|||
|
||||
MultiTouchInput
|
||||
nsBaseWidget::UpdateSynthesizedTouchState(MultiTouchInput* aState,
|
||||
uint32_t aTime,
|
||||
mozilla::TimeStamp aTimeStamp,
|
||||
uint32_t aPointerId,
|
||||
TouchPointerState aPointerState,
|
||||
LayoutDeviceIntPoint aPoint,
|
||||
|
@ -2089,6 +2091,8 @@ nsBaseWidget::UpdateSynthesizedTouchState(MultiTouchInput* aState,
|
|||
// touch(es). We use |inputToDispatch| for this purpose.
|
||||
MultiTouchInput inputToDispatch;
|
||||
inputToDispatch.mInputType = MULTITOUCH_INPUT;
|
||||
inputToDispatch.mTime = aTime;
|
||||
inputToDispatch.mTimeStamp = aTimeStamp;
|
||||
|
||||
int32_t index = aState->IndexOfTouch((int32_t)aPointerId);
|
||||
if (aPointerState == TOUCH_CONTACT) {
|
||||
|
|
|
@ -568,6 +568,8 @@ protected:
|
|||
*/
|
||||
mozilla::MultiTouchInput
|
||||
UpdateSynthesizedTouchState(mozilla::MultiTouchInput* aState,
|
||||
uint32_t aTime,
|
||||
mozilla::TimeStamp aTimeStamp,
|
||||
uint32_t aPointerId,
|
||||
TouchPointerState aPointerState,
|
||||
LayoutDeviceIntPoint aPoint,
|
||||
|
|
Загрузка…
Ссылка в новой задаче