gui.cpp: Only report touchscreen input when screen is on
Some devices like the Asus Zenfone7 and Zenfone9 wake the screen when is off on input event even without TW_NO_SCREEN_BLANK flag set.
Only KEY_POWER can wake the device now, vol button can't wake it anymore too
Change-Id: Icebaa30092e434957797596e0a81c568f2996c92
(cherry picked from commit 1682703ff13072e42116fd5a18bdfee7eadbb92b)
diff --git a/gui/gui.cpp b/gui/gui.cpp
index e905812..984cf5d 100755
--- a/gui/gui.cpp
+++ b/gui/gui.cpp
@@ -206,9 +206,14 @@
break;
}
- if (ev.code != KEY_POWER && ev.code > KEY_RESERVED)
- blankTimer.resetTimerAndUnblank();
-
+#ifndef TW_NO_SCREEN_BLANK
+ if (!blankTimer.isScreenOff()) {
+#endif
+ if (ev.code != KEY_POWER && ev.code > KEY_RESERVED)
+ blankTimer.resetTimerAndUnblank();
+#ifndef TW_NO_SCREEN_BLANK
+ }
+#endif
return true; // we got an event, so there might be more in the queue
}