Bug 931445 part 3 - Reset synth centering pointer when unlocking pointer. r=smaug
☠☠ backed out by 919296e383f6 ☠ ☠
authorXidorn Quan <me@upsuper.org>
Fri, 27 May 2016 11:09:58 +1000
changeset 338261 79ba5815f9aa29772dd6bbfc8178999957c0c7ea
parent 338260 b084784405ef73f3e895af2fdee748c2c2d51789
child 338262 5a92875424b0e8bb9fbd0858de85ebad4852b033
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs931445
milestone49.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 931445 part 3 - Reset synth centering pointer when unlocking pointer. r=smaug MozReview-Commit-ID: LcStCmm4iRV
dom/events/EventStateManager.cpp
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -4396,16 +4396,19 @@ EventStateManager::SetPointerLock(nsIWid
       dragService->Suppress();
     }
   } else {
     // Unlocking, so return pointer to the original position by firing a
     // synthetic mouse event. We first reset sLastRefPoint to its
     // pre-pointerlock position, so that the synthetic mouse event reports
     // no movement.
     sLastRefPoint = mPreLockPoint;
+    // Reset SynthCenteringPoint to invalid so that next time we start
+    // locking pointer, it has its initial value.
+    sSynthCenteringPoint = kInvalidRefPoint;
     if (aWidget) {
       aWidget->SynthesizeNativeMouseMove(
         mPreLockPoint + aWidget->WidgetToScreenOffset(), nullptr);
     }
 
     // Don't retarget events to this element any more.
     nsIPresShell::SetCapturingContent(nullptr, CAPTURE_POINTERLOCK);