Bug 1414698 - Part 1: Stop gamepad vibration when changing to the background; r?baku
MozReview-Commit-ID: 4Xxif7K500B
--- 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();
}