summaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--gui/blanktimer.cpp7
-rw-r--r--gui/blanktimer.hpp2
-rw-r--r--gui/pages.cpp5
3 files changed, 14 insertions, 0 deletions
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);
diff --git a/gui/blanktimer.hpp b/gui/blanktimer.hpp
index 2d83c4dae..60d5b1b42 100644
--- a/gui/blanktimer.hpp
+++ b/gui/blanktimer.hpp
@@ -30,6 +30,7 @@ class blanktimer {
int setTimerThread(void);
void resetTimerAndUnblank(void);
void setTime(int newtime);
+ bool IsScreenOff();
private:
void setConBlank(int blank);
@@ -47,6 +48,7 @@ class blanktimer {
timespec btimer;
unsigned long long sleepTimer;
int orig_brightness;
+ bool screenoff;
};
extern blanktimer blankTimer;
diff --git a/gui/pages.cpp b/gui/pages.cpp
index 11fe9b080..86d4dff9f 100644
--- a/gui/pages.cpp
+++ b/gui/pages.cpp
@@ -41,8 +41,10 @@ extern "C" {
#include "rapidxml.hpp"
#include "objects.hpp"
+#include "blanktimer.hpp"
extern int gGuiRunning;
+extern blanktimer blankTimer;
std::map<std::string, PageSet*> PageManager::mPageSets;
PageSet* PageManager::mCurrentSet;
@@ -890,6 +892,9 @@ int PageManager::Render(void)
int PageManager::Update(void)
{
+ if(blankTimer.IsScreenOff())
+ return 0;
+
return (mCurrentSet ? mCurrentSet->Update() : -1);
}