fix(core): always redraw screen when waking up from suspend
What changed, and why it matters
This small change makes a Trezor device always redraw its screen and refresh the idle timer after waking from suspend, regardless of what triggered the wakeup. Previously, the screen was only redrawn when the user pressed a button to wake the device. The fix prevents a stale or blank screen from remaining visible after other wakeup events, which could confuse the user about the device's true state.
Treat as a low-severity reliability/UI fix. Review whether any other wakeup paths (USB events, timer wakeups, etc.) could leave sensitive UI elements in an inconsistent state, and verify that `repaint()` is safe to call unconditionally after all suspend wakeups.
Security signals we found
UI state desynchronization after resume from suspend
Removal of wakeup-source-specific UI refresh logic
Potential for stale screen content to mislead user about device state
Evidence from the diff
The patch removes the conditional check if wakeup_flag == io.pm.WAKEUP_FLAG_BUTTON and unconditionally calls workflow.idle_timer.touch() and CURRENT_LAYOUT.repaint() after suspend_device() returns. The previous code only refreshed the UI on button wakeups, leaving the display potentially stale for other wakeup sources. The commit message frames this as a UI consistency fix with no changelog entry.
Changed components
core/src/apps/common/lock_manager.pyTrezor Core lock/suspend managementDisplay/backlight repaint pathInspect captured patch +5 / −5
diff --git a/core/src/apps/common/lock_manager.py b/core/src/apps/common/lock_manager.py
index 66f01423e..84271690d 100644
--- a/core/src/apps/common/lock_manager.py
+++ b/core/src/apps/common/lock_manager.py
@@ -67,12 +67,12 @@ else:
# fadeout the screen
backlight_fade(BacklightLevels.NONE)
# suspend the device
- wakeup_flag = suspend_device()
+ suspend_device()
- if wakeup_flag == io.pm.WAKEUP_FLAG_BUTTON:
- workflow.idle_timer.touch()
- if CURRENT_LAYOUT is not None:
- CURRENT_LAYOUT.repaint()
+ # redraw the screen and touch idle timer
+ workflow.idle_timer.touch()
+ if CURRENT_LAYOUT is not None:
+ CURRENT_LAYOUT.repaint()
_SHOULD_SUSPEND = False
set_homescreen()
Why this scored 26/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.