Bug 1833950 - Handle duplicate pan-end on fling state too. r=botond

Differential Revision: https://phabricator.services.mozilla.com/D178483
This commit is contained in:
Emilio Cobos Álvarez 2023-05-26 10:59:04 +00:00
Родитель 5e0dac9fef
Коммит 4252cb490e
1 изменённых файлов: 5 добавлений и 4 удалений

Просмотреть файл

@ -1853,7 +1853,7 @@ nsEventStatus AsyncPanZoomController::OnScaleEnd(
}
nsEventStatus AsyncPanZoomController::HandleEndOfPan() {
MOZ_ASSERT(mAnimation == nullptr);
MOZ_ASSERT(!mAnimation);
MOZ_ASSERT(GetCurrentTouchBlock() || GetCurrentPanGestureBlock());
GetCurrentInputBlock()->GetOverscrollHandoffChain()->FlushRepaints();
ParentLayerPoint flingVelocity = GetVelocityVector();
@ -2883,11 +2883,12 @@ nsEventStatus AsyncPanZoomController::OnPanEnd(const PanGestureInput& aEvent) {
APZC_LOG_DETAIL("got a pan-end in state %s\n", this,
ToString(mState).c_str());
// This can happen if the OS sends a second pan-end event after
// the first one has already started an overscroll animation.
// This can happen if the OS sends a second pan-end event after the first one
// has already started an overscroll animation or entered a fling state.
// This has been observed on some Wayland versions.
PanZoomState currentState = GetState();
if (currentState == OVERSCROLL_ANIMATION || currentState == NOTHING) {
if (currentState == OVERSCROLL_ANIMATION || currentState == NOTHING ||
currentState == FLING) {
return nsEventStatus_eIgnore;
}