Bug 1414698 - Part 1: Stop gamepad vibration when changing to the background; r=baku
authorDaosheng Mu <daoshengmu@gmail.com>
Mon, 06 Nov 2017 17:31:47 +0800
changeset 443674 46690f53a2f76e138d9d3518b31d641af1c39836
parent 443673 28be6e4365d96a89a1250cd95eeb9c39568043dd
child 443675 fb5d2596b7a0b5aa0d273c70f119ffc5c36a774d
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1414698
milestone58.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 1414698 - Part 1: Stop gamepad vibration when changing to the background; r=baku MozReview-Commit-ID: 4Xxif7K500B
dom/base/nsGlobalWindow.cpp
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -10636,17 +10636,17 @@ void nsGlobalWindow::SetIsBackground(boo
 
   if (inner && changed) {
     inner->mTimeoutManager->UpdateBackgroundState();
   }
 
   if (aIsBackground) {
     // Notify gamepadManager we are at the background window,
     // we need to stop vibrate.
-    if (inner) {
+    if (inner && changed) {
       inner->StopGamepadHaptics();
     }
     return;
   }
 
   if (inner) {
     inner->SyncGamepadState();
   }