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))
