Bug 1754674 - Send a pan end event before momentum events on Windows. r=tnikkel
authorHiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
Thu, 10 Feb 2022 07:24:59 +0000 (2022-02-10)
changeset 607316 4bea3a445c03bcd059f6e0379d228c10cbff398d
parent 607315 ed0f946ecb73cfeb96fb75ce66acd81e7b222a78
child 607317 bcdf8499dfa874dda0085a3ecf939c33348c867d
push id39267
push userimoraru@mozilla.com
push dateThu, 10 Feb 2022 16:46:13 +0000 (2022-02-10)
treeherdermozilla-central@fc003b933e95 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstnikkel
bugs1754674
milestone99.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1754674 - Send a pan end event before momentum events on Windows. r=tnikkel Differential Revision: https://phabricator.services.mozilla.com/D138401
widget/windows/DirectManipulationOwner.cpp
--- a/widget/windows/DirectManipulationOwner.cpp
+++ b/widget/windows/DirectManipulationOwner.cpp
@@ -211,21 +211,18 @@ void DManipEventHandler::TransitionToSta
   }
 
   State prevState = mState;
   mState = 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: {
       // eInertia -> *: MomentumEnd
       SendPan(Phase::eEnd, 0.f, 0.f, true);
       break;
     }
     case State::ePinching: {
@@ -299,17 +296,17 @@ DManipEventHandler::OnContentUpdated(IDi
   // Not different from last time.
   if (FuzzyEqualsMultiplicative(scale, mLastScale) && xoffset == mLastXOffset &&
       yoffset == mLastYOffset) {
     return S_OK;
   }
 
   // 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 {
     // Pinch gesture may begin with some scroll events.
     TransitionToState(State::ePinching);
   }
 
   if (mState == State::ePanning || mState == State::eInertia) {