Bug 965381 - Delay the single tap notification until after the touchdown is handled. r=daleharvey
This commit is contained in:
@@ -963,7 +963,15 @@ nsEventStatus AsyncPanZoomController::OnSingleTapUp(const TapGestureInput& aEven
|
||||
int32_t modifiers = WidgetModifiersToDOMModifiers(aEvent.modifiers);
|
||||
CSSIntPoint geckoScreenPoint;
|
||||
if (ConvertToGecko(aEvent.mPoint, &geckoScreenPoint)) {
|
||||
controller->HandleSingleTap(geckoScreenPoint, modifiers, GetGuid());
|
||||
// Because this may be being running as part of APZCTreeManager::ReceiveInputEvent,
|
||||
// calling controller->HandleSingleTap directly might mean that content receives
|
||||
// the single tap message before the corresponding touch-up. To avoid that we
|
||||
// schedule the singletap message to run on the next spin of the event loop.
|
||||
// See bug 965381 for the issue this was causing.
|
||||
controller->PostDelayedTask(
|
||||
NewRunnableMethod(controller.get(), &GeckoContentController::HandleSingleTap,
|
||||
geckoScreenPoint, modifiers, GetGuid()),
|
||||
0);
|
||||
return nsEventStatus_eConsumeNoDefault;
|
||||
}
|
||||
}
|
||||
@@ -977,7 +985,11 @@ nsEventStatus AsyncPanZoomController::OnSingleTapConfirmed(const TapGestureInput
|
||||
int32_t modifiers = WidgetModifiersToDOMModifiers(aEvent.modifiers);
|
||||
CSSIntPoint geckoScreenPoint;
|
||||
if (ConvertToGecko(aEvent.mPoint, &geckoScreenPoint)) {
|
||||
controller->HandleSingleTap(geckoScreenPoint, modifiers, GetGuid());
|
||||
// See comment in OnSingleTapUp as to why we do this in PostDelayedTask.
|
||||
controller->PostDelayedTask(
|
||||
NewRunnableMethod(controller.get(), &GeckoContentController::HandleSingleTap,
|
||||
geckoScreenPoint, modifiers, GetGuid()),
|
||||
0);
|
||||
return nsEventStatus_eConsumeNoDefault;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user