From 0d9133d654805be31a7e21f4ccb74e9e0a44fd55 Mon Sep 17 00:00:00 2001 From: gordon1337 Date: Sat, 8 Jun 2013 14:17:07 +0200 Subject: 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. --- gui/blanktimer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gui/blanktimer.cpp') diff --git a/gui/blanktimer.cpp b/gui/blanktimer.cpp index 700a9ad27..0b1f0083c 100644 --- a/gui/blanktimer.cpp +++ b/gui/blanktimer.cpp @@ -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); -- cgit v1.2.3