Bug 1414698 - Part 1: Stop gamepad vibration when changing to the background; r?baku draft
authorDaosheng Mu <daoshengmu@gmail.com>
Mon, 06 Nov 2017 17:31:47 +0800
changeset 693796 dd00bb9adc0afc27d38201c638f8ba34c5920fbf
parent 693376 179dae92e4d794e7f45ad080ff01908c80691f31
child 693797 3bcf46be654c939a1e325140fdab6726c7c979b1
push id87920
push userbmo:dmu@mozilla.com
push dateMon, 06 Nov 2017 21:36:01 +0000
reviewersbaku
bugs1414698
milestone58.0a1
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();
   }