mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-28 19:38:13 +00:00
Bug 946661 - Dont send tapconfirmed event when tapup was handled. r=kats
This commit is contained in:
parent
e95fed93c5
commit
f90a83a007
@ -824,6 +824,8 @@ nsEventStatus AsyncPanZoomController::OnLongPress(const TapGestureInput& aEvent)
|
||||
nsEventStatus AsyncPanZoomController::OnSingleTapUp(const TapGestureInput& aEvent) {
|
||||
APZC_LOG("%p got a single-tap-up in state %d\n", this, mState);
|
||||
nsRefPtr<GeckoContentController> controller = GetGeckoContentController();
|
||||
// If mAllowZoom is true we wait for a call to OnSingleTapConfirmed before
|
||||
// sending event to content
|
||||
if (controller && !mAllowZoom) {
|
||||
int32_t modifiers = WidgetModifiersToDOMModifiers(aEvent.modifiers);
|
||||
CSSIntPoint geckoScreenPoint;
|
||||
@ -838,8 +840,7 @@ nsEventStatus AsyncPanZoomController::OnSingleTapUp(const TapGestureInput& aEven
|
||||
nsEventStatus AsyncPanZoomController::OnSingleTapConfirmed(const TapGestureInput& aEvent) {
|
||||
APZC_LOG("%p got a single-tap-confirmed in state %d\n", this, mState);
|
||||
nsRefPtr<GeckoContentController> controller = GetGeckoContentController();
|
||||
// If zooming is disabled, we handle this in OnSingleTapUp
|
||||
if (controller && mAllowZoom) {
|
||||
if (controller) {
|
||||
int32_t modifiers = WidgetModifiersToDOMModifiers(aEvent.modifiers);
|
||||
CSSIntPoint geckoScreenPoint;
|
||||
if (ConvertToGecko(aEvent.mPoint, &geckoScreenPoint)) {
|
||||
|
@ -167,19 +167,25 @@ nsEventStatus GestureEventListener::HandleInputEvent(const InputData& aEvent)
|
||||
mState = GESTURE_NONE;
|
||||
} else if (mState == GESTURE_WAITING_SINGLE_TAP) {
|
||||
CancelLongTapTimeoutTask();
|
||||
HandleSingleTapUpEvent(event);
|
||||
nsEventStatus tapupEvent = HandleSingleTapUpEvent(event);
|
||||
|
||||
// We were not waiting for anything but a single tap has happened that
|
||||
// may turn into a double tap. Wait a while and if it doesn't turn into
|
||||
// a double tap, send a single tap instead.
|
||||
mState = GESTURE_WAITING_DOUBLE_TAP;
|
||||
if (tapupEvent == nsEventStatus_eIgnore) {
|
||||
// We were not waiting for anything but a single tap has happened that
|
||||
// may turn into a double tap. Wait a while and if it doesn't turn into
|
||||
// a double tap, send a single tap instead.
|
||||
mState = GESTURE_WAITING_DOUBLE_TAP;
|
||||
|
||||
mDoubleTapTimeoutTask =
|
||||
NewRunnableMethod(this, &GestureEventListener::TimeoutDoubleTap);
|
||||
mDoubleTapTimeoutTask =
|
||||
NewRunnableMethod(this, &GestureEventListener::TimeoutDoubleTap);
|
||||
|
||||
mAsyncPanZoomController->PostDelayedTask(
|
||||
mDoubleTapTimeoutTask,
|
||||
MAX_TAP_TIME);
|
||||
mAsyncPanZoomController->PostDelayedTask(
|
||||
mDoubleTapTimeoutTask,
|
||||
MAX_TAP_TIME);
|
||||
|
||||
} else if (tapupEvent == nsEventStatus_eConsumeNoDefault) {
|
||||
// We sent the tapup into content without waiting for a double tap
|
||||
mState = GESTURE_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
mLastTapEndTime = event.mTime;
|
||||
|
Loading…
Reference in New Issue
Block a user