tap-wake: re-check the screen on taps while 'awake'
If something else turned the screen off during the wake minute (the 9pm cron, a kiosk restart from an update), taps only extended the timer and never turned it back on, so it stayed dark until nobody touched it for a full minute. Now every tap (at most every 2s) checks the real screen state.
This commit is contained in:
1 parent
f0bccb2a5e
commit
3a4dd3c4ca
1 file changed
+2
-1
+2
-1
@@ -49,8 +49,9 @@ while True:
|
||||
os.read(fd, 4096)
|
||||
if wake_until is not None:
|
||||
wake_until = now + AWAKE_SECONDS # keep it on while being used
|
||||
elif now - last_check > 2: # a swipe is lots of events; check once
|
||||
if now - last_check > 2: # a swipe is lots of events; check every 2s
|
||||
last_check = now
|
||||
# check even while "awake": cron or a kiosk restart may have turned it off under us
|
||||
if screen_is_off():
|
||||
subprocess.run([SCREEN, "dim"], env=ENV)
|
||||
wake_until = now + AWAKE_SECONDS
|
||||
|
||||
Reference in new issue
Block a user