Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #7238 from vingtetun/822463

Bug 822463 - If I hit power button just before taking a screenshot, phon...
  • Loading branch information...
commit 1e1426f7f4f2925293feea4917df03d5d690d2bf 2 parents 39d283d + 4d50dd0
@vingtetun vingtetun authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 apps/system/js/screen_manager.js
View
8 apps/system/js/screen_manager.js
@@ -235,6 +235,14 @@ var ScreenManager = {
self.screen.classList.add('screenoff');
setTimeout(function realScreenOff() {
self.setScreenBrightness(0, true);
+ // Sometimes the ScreenManager.screenEnabled and mozPower.screenEnabled
+ // values are out of sync. Since the rest of the world relies only on
+ // the value of ScreenManager.screenEnabled it can be some situations
+ // where the screen is off but ScreenManager think it is on... (see
+ // bug 822463). Ideally a callback should have been used, like
+ // ScreenManager.getScreenState(function(value) { ...} ); but there
+ // are too many places to change that for now.
+ self.screenEnabled = false;
navigator.mozPower.screenEnabled = false;
}, 20);
Please sign in to comment.
Something went wrong with that request. Please try again.