Do not render the GUI when the blanktimer turns off the display.

Normally, when the display has been turned off by blanktimer, the GUI actually still renders the GUI elements (eg. progressbar while doing backup/restore/etc.)
This patch will check whenever the display is turned off, and if it is turned off simply dont render. This avoids heating up the device and will save battery.
This commit is contained in:
gordon1337
2013-06-08 14:17:07 +02:00
parent 1035509376
commit 0d9133d654
3 changed files with 14 additions and 0 deletions
+7
View File
@@ -48,6 +48,11 @@ blanktimer::blanktimer(void) {
setTime(0);
setConBlank(0);
orig_brightness = getBrightness();
screenoff = false;
}
bool blanktimer::IsScreenOff() {
return screenoff;
}
void blanktimer::setTime(int newtime) {
@@ -92,6 +97,7 @@ int blanktimer::setClockTimer(void) {
if (sleepTimer && diff.tv_sec > sleepTimer && conblank < 2) {
setConBlank(2);
setBrightness(0);
screenoff = true;
PageManager::ChangeOverlay("lock");
}
#ifndef TW_NO_SCREEN_BLANK
@@ -146,6 +152,7 @@ void blanktimer::resetTimerAndUnblank(void) {
// No break here, we want to keep going
case 2:
gui_forceRender();
screenoff = false;
// No break here, we want to keep going
case 1:
setBrightness(orig_brightness);