diff --git a/data.cpp b/data.cpp
index 3259a21..d82d285 100644
--- a/data.cpp
+++ b/data.cpp
@@ -73,9 +73,6 @@
 string                                  DataManager::mBackingFile;
 int                                     DataManager::mInitialized = 0;
 
-#ifndef TW_NO_SCREEN_TIMEOUT
-extern blanktimer blankTimer;
-#endif
 extern bool datamedia;
 
 pthread_mutex_t DataManager::m_valuesLock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER;
diff --git a/gui/action.cpp b/gui/action.cpp
index 9534399..a341e4a 100644
--- a/gui/action.cpp
+++ b/gui/action.cpp
@@ -42,9 +42,7 @@
 
 #include "../adb_install.h"
 #include "../fuse_sideload.h"
-#ifndef TW_NO_SCREEN_TIMEOUT
 #include "blanktimer.hpp"
-#endif
 extern "C" {
 #include "../twcommon.h"
 #include "../minuitwrp/minui.h"
@@ -59,10 +57,6 @@
 #include "rapidxml.hpp"
 #include "objects.hpp"
 
-#ifndef TW_NO_SCREEN_TIMEOUT
-extern blanktimer blankTimer;
-#endif
-
 void curtainClose(void);
 
 GUIAction::mapFunc GUIAction::mf;
@@ -446,9 +440,7 @@
 	}
 	DataManager::SetValue("tw_operation_state", 1);
 	DataManager::SetValue(TW_ACTION_BUSY, 0);
-#ifndef TW_NO_SCREEN_TIMEOUT
 	blankTimer.resetTimerAndUnblank();
-#endif
 	time(&Stop);
 	if ((int) difftime(Stop, Start) > 10)
 		DataManager::Vibrate("tw_action_vibrate");
diff --git a/gui/blanktimer.cpp b/gui/blanktimer.cpp
index 371d3f1..95b6c47 100644
--- a/gui/blanktimer.cpp
+++ b/gui/blanktimer.cpp
@@ -17,97 +17,66 @@
 */
 
 using namespace std;
-#include "rapidxml.hpp"
-using namespace rapidxml;
-extern "C" {
-#include "../minuitwrp/minui.h"
-}
 #include <string>
-#include <vector>
-#include <map>
-#include "resources.hpp"
 #include <pthread.h>
 #include <sys/time.h>
 #include <time.h>
 #include <unistd.h>
-#include <pixelflinger/pixelflinger.h>
-#include <linux/kd.h>
-#include <linux/fb.h>
-#include <sstream>
 #include "pages.hpp"
 #include "blanktimer.hpp"
-#include "objects.hpp"
 #include "../data.hpp"
 extern "C" {
+#include "../minuitwrp/minui.h"
 #include "../twcommon.h"
 }
 #include "../twrp-functions.hpp"
 #include "../variables.h"
 
 blanktimer::blanktimer(void) {
-	setTime(0);
-	setConBlank(0);
+	pthread_mutex_init(&mutex, NULL);
+	setTime(0); // no timeout
+	state = kOn;
 	orig_brightness = getBrightness();
-	screenoff = false;
 }
 
-bool blanktimer::IsScreenOff() {
-	return screenoff;
+bool blanktimer::isScreenOff() {
+	return state >= kOff;
 }
 
 void blanktimer::setTime(int newtime) {
+	pthread_mutex_lock(&mutex);
 	sleepTimer = newtime;
-}
-
-int blanktimer::setTimerThread(void) {
-	pthread_t thread;
-	ThreadPtr blankptr = &blanktimer::setClockTimer;
-	PThreadPtr p = *(PThreadPtr*)&blankptr;
-	pthread_create(&thread, NULL, p, this);
-	return 0;
-}
-
-void blanktimer::setConBlank(int blank) {
-	pthread_mutex_lock(&conblankmutex);
-	conblank = blank;
-	pthread_mutex_unlock(&conblankmutex);
+	pthread_mutex_unlock(&mutex);
 }
 
 void blanktimer::setTimer(void) {
-	pthread_mutex_lock(&timermutex);
 	clock_gettime(CLOCK_MONOTONIC, &btimer);
-	pthread_mutex_unlock(&timermutex);
 }
 
-timespec blanktimer::getTimer(void) {
-	return btimer;
-}
-
-int  blanktimer::setClockTimer(void) {
+void blanktimer::checkForTimeout() {
+#ifndef TW_NO_SCREEN_TIMEOUT
+	pthread_mutex_lock(&mutex);
 	timespec curTime, diff;
-	for(;;) {
-		usleep(1000000);
-		clock_gettime(CLOCK_MONOTONIC, &curTime);
-		diff = TWFunc::timespec_diff(btimer, curTime);
-		if (sleepTimer > 2 && diff.tv_sec > (sleepTimer - 2) && conblank == 0) {
-			orig_brightness = getBrightness();
-			setConBlank(1);
-			TWFunc::Set_Brightness("5");
-		}
-		if (sleepTimer && diff.tv_sec > sleepTimer && conblank < 2) {
-			setConBlank(2);
-			TWFunc::Set_Brightness("0");
-			screenoff = true;
-			TWFunc::check_and_run_script("/sbin/postscreenblank.sh", "blank");
-			PageManager::ChangeOverlay("lock");
-		}
-#ifndef TW_NO_SCREEN_BLANK
-		if (conblank == 2 && gr_fb_blank(1) >= 0) {
-			setConBlank(3);
-		}
-#endif
+	clock_gettime(CLOCK_MONOTONIC, &curTime);
+	diff = TWFunc::timespec_diff(btimer, curTime);
+	if (sleepTimer > 2 && diff.tv_sec > (sleepTimer - 2) && state == kOn) {
+		orig_brightness = getBrightness();
+		state = kDim;
+		TWFunc::Set_Brightness("5");
 	}
-	return -1; //shouldn't get here
+	if (sleepTimer && diff.tv_sec > sleepTimer && state < kOff) {
+		state = kOff;
+		TWFunc::Set_Brightness("0");
+		TWFunc::check_and_run_script("/sbin/postscreenblank.sh", "blank");
+		PageManager::ChangeOverlay("lock");
+	}
+#ifndef TW_NO_SCREEN_BLANK
+	if (state == kOff && gr_fb_blank(1) >= 0) {
+		state = kBlanked;
+	}
+#endif
+	pthread_mutex_unlock(&mutex);
+#endif
 }
 
 string blanktimer::getBrightness(void) {
@@ -125,25 +94,30 @@
 }
 
 void blanktimer::resetTimerAndUnblank(void) {
+#ifndef TW_NO_SCREEN_TIMEOUT
+	pthread_mutex_lock(&mutex);
 	setTimer();
-	switch (conblank) {
-		case 3:
+	switch (state) {
+		case kBlanked:
 #ifndef TW_NO_SCREEN_BLANK
 			if (gr_fb_blank(0) < 0) {
 				LOGINFO("blanktimer::resetTimerAndUnblank failed to gr_fb_blank(0)\n");
 				break;
 			}
 #endif
+			// TODO: this is asymmetric with postscreenblank.sh - shouldn't it be under the next case label?
 			TWFunc::check_and_run_script("/sbin/postscreenunblank.sh", "unblank");
 			// No break here, we want to keep going
-		case 2:
+		case kOff:
 			gui_forceRender();
-			screenoff = false;
 			// No break here, we want to keep going
-		case 1:
+		case kDim:
 			if (orig_brightness != "/nobrightness")
 				TWFunc::Set_Brightness(orig_brightness);
-			setConBlank(0);
+			state = kOn;
+		case kOn:
 			break;
 	}
+	pthread_mutex_unlock(&mutex);
+#endif
 }
diff --git a/gui/blanktimer.hpp b/gui/blanktimer.hpp
index c8159f6..5e61790 100644
--- a/gui/blanktimer.hpp
+++ b/gui/blanktimer.hpp
@@ -19,7 +19,6 @@
 #ifndef __BLANKTIMER_HEADER_HPP
 #define __BLANKTIMER_HEADER_HPP
 
-#include <pthread.h>
 #include <sys/time.h>
 
 using namespace std;
@@ -27,32 +26,29 @@
 class blanktimer
 {
 public:
-	blanktimer(void);
+	blanktimer();
 
-	int setTimerThread(void);
-	void resetTimerAndUnblank(void);
+	// set timeout in seconds
 	void setTime(int newtime);
-	bool IsScreenOff();
+
+	// call this in regular intervals
+	void checkForTimeout();
+
+	// call this when an input event is received or when an operation is finished
+	void resetTimerAndUnblank();
+
+	bool isScreenOff();
 
 private:
-	typedef int (blanktimer::*ThreadPtr)(void);
-	typedef void* (*PThreadPtr)(void*);
-
-	void setConBlank(int blank);
 	void setTimer(void);
-	timespec getTimer(void);
 	string getBrightness(void);
-	int setBrightness(int brightness);
-	int setBlankTimer(void);
-	int setClockTimer(void);
 
-	pthread_mutex_t conblankmutex;
-	pthread_mutex_t timermutex;
-	int conblank;
+	pthread_mutex_t mutex;
+	enum State { kOn = 0, kDim = 1, kOff = 2, kBlanked = 3 };
+	State state;
 	timespec btimer;
-	unsigned long long sleepTimer;
+	long sleepTimer;
 	string orig_brightness;
-	bool screenoff;
 };
 
 extern blanktimer blankTimer;
diff --git a/gui/gui.cpp b/gui/gui.cpp
index db6e23f..edf2d76 100644
--- a/gui/gui.cpp
+++ b/gui/gui.cpp
@@ -50,9 +50,7 @@
 #include "../twrp-functions.hpp"
 #include "../openrecoveryscript.hpp"
 #include "../orscmd/orscmd.h"
-#ifndef TW_NO_SCREEN_TIMEOUT
 #include "blanktimer.hpp"
-#endif
 
 // Enable to print render time of each frame to the log file
 //#define PRINT_RENDER_TIME 1
@@ -71,9 +69,7 @@
 static int gNoAnimation = 1;
 static int gGuiInputRunning = 0;
 static int gCmdLineRunning = 0;
-#ifndef TW_NO_SCREEN_TIMEOUT
 blanktimer blankTimer;
-#endif
 
 // Needed by pages.cpp too
 int gGuiRunning = 0;
@@ -178,24 +174,23 @@
 
 static void * input_thread(void *cookie)
 {
-
 	int drag = 0;
 	static int touch_and_hold = 0, dontwait = 0;
 	static int touch_repeat = 0, key_repeat = 0;
 	static int x = 0, y = 0;
-	static int lshift = 0, rshift = 0;
 	static struct timeval touchStart;
-	string seconds;
 	HardwareKeyboard *kb = PageManager::GetHardwareKeyboard();
 	MouseCursor *cursor = PageManager::GetMouseCursor();
 
 #ifndef TW_NO_SCREEN_TIMEOUT
-	//start screen timeout threads
-	blankTimer.setTimerThread();
-	DataManager::GetValue("tw_screen_timeout_secs", seconds);
-	blankTimer.setTime(atoi(seconds.c_str()));
+	{
+		string seconds;
+		DataManager::GetValue("tw_screen_timeout_secs", seconds);
+		blankTimer.setTime(atoi(seconds.c_str()));
+		blankTimer.resetTimerAndUnblank();
+	}
 #else
-	LOGINFO("Skipping screen timeout threads: TW_NO_SCREEN_TIMEOUT is set\n");
+	LOGINFO("Skipping screen timeout: TW_NO_SCREEN_TIMEOUT is set\n");
 #endif
 
 	for (;;)
@@ -225,9 +220,7 @@
 				LOGERR("TOUCH_HOLD: %d,%d\n", x, y);
 #endif
 				PageManager::NotifyTouch(TOUCH_HOLD, x, y);
-#ifndef TW_NO_SCREEN_TIMEOUT
 				blankTimer.resetTimerAndUnblank();
-#endif
 			}
 			else if (touch_repeat && mtime > 100)
 			{
@@ -236,9 +229,7 @@
 #endif
 				gettimeofday(&touchStart, NULL);
 				PageManager::NotifyTouch(TOUCH_REPEAT, x, y);
-#ifndef TW_NO_SCREEN_TIMEOUT
 				blankTimer.resetTimerAndUnblank();
-#endif
 			}
 			else if (key_repeat == 1 && mtime > 500)
 			{
@@ -248,9 +239,7 @@
 				gettimeofday(&touchStart, NULL);
 				key_repeat = 2;
 				kb->KeyRepeat();
-#ifndef TW_NO_SCREEN_TIMEOUT
 				blankTimer.resetTimerAndUnblank();
-#endif
 
 			}
 			else if (key_repeat == 2 && mtime > 100)
@@ -260,9 +249,7 @@
 #endif
 				gettimeofday(&touchStart, NULL);
 				kb->KeyRepeat();
-#ifndef TW_NO_SCREEN_TIMEOUT
 				blankTimer.resetTimerAndUnblank();
-#endif
 			}
 		}
 		else if (ev.type == EV_ABS)
@@ -279,9 +266,7 @@
 					LOGERR("TOUCH_RELEASE: %d,%d\n", x, y);
 #endif
 					PageManager::NotifyTouch(TOUCH_RELEASE, x, y);
-#ifndef TW_NO_SCREEN_TIMEOUT
 					blankTimer.resetTimerAndUnblank();
-#endif
 					touch_and_hold = 0;
 					touch_repeat = 0;
 					if (!key_repeat)
@@ -306,9 +291,7 @@
 						key_repeat = 0;
 						gettimeofday(&touchStart, NULL);
 					}
-#ifndef TW_NO_SCREEN_TIMEOUT
 					blankTimer.resetTimerAndUnblank();
-#endif
 				}
 				else
 				{
@@ -320,9 +303,7 @@
 						if (PageManager::NotifyTouch(TOUCH_DRAG, x, y) > 0)
 							state = 1;
 						key_repeat = 0;
-#ifndef TW_NO_SCREEN_TIMEOUT
 						blankTimer.resetTimerAndUnblank();
-#endif
 					}
 				}
 			}
@@ -384,17 +365,13 @@
 					touch_repeat = 0;
 					dontwait = 1;
 					gettimeofday(&touchStart, NULL);
-#ifndef TW_NO_SCREEN_TIMEOUT
 					blankTimer.resetTimerAndUnblank();
-#endif
 				} else {
 					key_repeat = 0;
 					touch_and_hold = 0;
 					touch_repeat = 0;
 					dontwait = 0;
-#ifndef TW_NO_SCREEN_TIMEOUT
 					blankTimer.resetTimerAndUnblank();
-#endif
 				}
 			} else {
 				// This is a key release
@@ -403,9 +380,7 @@
 				touch_and_hold = 0;
 				touch_repeat = 0;
 				dontwait = 0;
-#ifndef TW_NO_SCREEN_TIMEOUT
 				blankTimer.resetTimerAndUnblank();
-#endif
 			}
 		}
 		else if(ev.type == EV_REL)
@@ -615,6 +590,7 @@
 			flip();
 		}
 
+		blankTimer.checkForTimeout();
 		if (DataManager::GetIntValue("tw_gui_done") != 0)
 			break;
 	}
@@ -665,6 +641,7 @@
 			PageManager::Render();
 			flip();
 		}
+		blankTimer.checkForTimeout();
 		if (DataManager::GetIntValue("tw_page_done") != 0)
 		{
 			gui_changePage("main");
@@ -750,8 +727,6 @@
 
 extern "C" int gui_init(void)
 {
-	int fd;
-
 	gr_init();
 
 	if (res_create_surface("/res/images/curtain.jpg", &gCurtain))
diff --git a/gui/pages.cpp b/gui/pages.cpp
index a1a6346..aae85ae 100644
--- a/gui/pages.cpp
+++ b/gui/pages.cpp
@@ -45,14 +45,9 @@
 
 #include "rapidxml.hpp"
 #include "objects.hpp"
-#ifndef TW_NO_SCREEN_TIMEOUT
 #include "blanktimer.hpp"
-#endif
 
 extern int gGuiRunning;
-#ifndef TW_NO_SCREEN_TIMEOUT
-extern blanktimer blankTimer;
-#endif
 
 std::map<std::string, PageSet*> PageManager::mPageSets;
 PageSet* PageManager::mCurrentSet;
@@ -1197,10 +1192,8 @@
 
 int PageManager::Update(void)
 {
-#ifndef TW_NO_SCREEN_TIMEOUT
-	if(blankTimer.IsScreenOff())
+	if(blankTimer.isScreenOff())
 		return 0;
-#endif
 
 	int res = (mCurrentSet ? mCurrentSet->Update() : -1);
 
diff --git a/gui/pages.hpp b/gui/pages.hpp
index f1179f5..2ce3e13 100644
--- a/gui/pages.hpp
+++ b/gui/pages.hpp
@@ -4,6 +4,18 @@
 #define _PAGES_HEADER_HPP
 
 #include "../minzip/Zip.h"
+#include <vector>
+#include <map>
+#include "rapidxml.hpp"
+using namespace rapidxml;
+
+enum TOUCH_STATE {
+	TOUCH_START = 0,
+	TOUCH_DRAG = 1,
+	TOUCH_RELEASE = 2,
+	TOUCH_HOLD = 3,
+	TOUCH_REPEAT = 4
+};
 
 typedef struct {
 	unsigned char red;
diff --git a/gui/resources.hpp b/gui/resources.hpp
index f359c55..1a86d54 100644
--- a/gui/resources.hpp
+++ b/gui/resources.hpp
@@ -23,14 +23,6 @@
 	static int ExtractResource(ZipArchive* pZip, std::string folderName, std::string fileName, std::string fileExtn, std::string destFile);
 };
 
-typedef enum {
-	TOUCH_START = 0,
-	TOUCH_DRAG = 1,
-	TOUCH_RELEASE = 2,
-	TOUCH_HOLD = 3,
-	TOUCH_REPEAT = 4
-} TOUCH_STATE;
-
 class FontResource : public Resource
 {
 public:
