diff --git a/gfx/layers/apz/src/AsyncPanZoomController.cpp b/gfx/layers/apz/src/AsyncPanZoomController.cpp index 41dd08cf9c02..98a06dcc4c36 100644 --- a/gfx/layers/apz/src/AsyncPanZoomController.cpp +++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp @@ -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; }