Skip to content

Commit

Permalink
Bug 1754674 - Send a pan end event before momentum events on Windows.…
Browse files Browse the repository at this point in the history
… r=tnikkel

Differential Revision: https://phabricator.services.mozilla.com/D138401
  • Loading branch information
hiikezoe committed Feb 10, 2022
1 parent 37a359a commit e1d5377
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions widget/windows/DirectManipulationOwner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,8 @@ void DManipEventHandler::TransitionToState(State aNewState) {
// End the previous sequence.
switch (prevState) {
case State::ePanning: {
// ePanning -> eNone, ePinching: PanEnd
// ePanning -> eInertia: we don't want to end the current scroll sequence.
if (aNewState != State::eInertia) {
SendPan(Phase::eEnd, 0.f, 0.f, false);
}
// ePanning -> *: PanEnd
SendPan(Phase::eEnd, 0.f, 0.f, false);
break;
}
case State::eInertia: {
Expand Down Expand Up @@ -304,7 +301,7 @@ DManipEventHandler::OnContentUpdated(IDirectManipulationViewport* viewport,

// Consider this is a Scroll when scale factor equals 1.0.
if (FuzzyEqualsMultiplicative(scale, 1.f)) {
if (mState == State::eNone || mState == State::eInertia) {
if (mState == State::eNone) {
TransitionToState(State::ePanning);
}
} else {
Expand Down

0 comments on commit e1d5377

Please sign in to comment.