Fix power button screen toggle instantly turning back on
Power button events were setting any_activity before the power handler's continue, causing the generic wake logic to immediately re-enable the screen. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -198,8 +198,6 @@ def main():
|
||||
if ev_type == EV_SYN:
|
||||
continue
|
||||
|
||||
any_activity = True
|
||||
|
||||
# Power button handling (EV_KEY only)
|
||||
if ev_type == EV_KEY and ev_code == KEY_POWER:
|
||||
if ev_value == 1: # press
|
||||
@@ -220,6 +218,8 @@ def main():
|
||||
# Between SHORT and LONG threshold: ignore (release before 3s)
|
||||
continue
|
||||
|
||||
any_activity = True
|
||||
|
||||
# Any input activity resets idle shutdown timer
|
||||
if any_activity:
|
||||
last_active_time = time.monotonic()
|
||||
|
||||
Reference in New Issue
Block a user