diff --git a/core/src/apps/debug/__init__.py b/core/src/apps/debug/__init__.py index 1e2917183..dde015f10 100644 --- a/core/src/apps/debug/__init__.py +++ b/core/src/apps/debug/__init__.py @@ -220,6 +220,8 @@ if __debug__: async def dispatch_DebugLinkRecordScreen(msg: DebugLinkRecordScreen) -> Success: if msg.target_directory: + from trezor import ui + # In case emulator is restarted but we still want to record screenshots # into the same directory as before, we need to increment the refresh index, # so that the screenshots are not overwritten. @@ -227,6 +229,7 @@ if __debug__: REFRESH_INDEX = msg.refresh_index storage.save_screen_directory = msg.target_directory storage.save_screen = True + ui.refresh() else: storage.save_screen = False display.clear_save() # clear C buffers diff --git a/core/src/trezor/loop.py b/core/src/trezor/loop.py index d631e54ae..9976ec339 100644 --- a/core/src/trezor/loop.py +++ b/core/src/trezor/loop.py @@ -20,9 +20,6 @@ if TYPE_CHECKING: AwaitableTask = Task | Awaitable Finalizer = Callable[[Task, Any], None] -# function to call after every task step -after_step_hook: Callable[[], None] | None = None - # tasks scheduled for execution in the future _queue = utimeq.utimeq(64) @@ -176,8 +173,6 @@ def _step(task: Task, value: Any) -> None: else: if __debug__: log.error(__name__, "unknown syscall: %s", result) - if after_step_hook: - after_step_hook() class Syscall: diff --git a/core/src/trezor/ui/__init__.py b/core/src/trezor/ui/__init__.py index 109ed105b..abad4ab76 100644 --- a/core/src/trezor/ui/__init__.py +++ b/core/src/trezor/ui/__init__.py @@ -47,12 +47,6 @@ if __debug__: else: refresh = display.refresh # type: ignore [obscured-by-same-name] - -# in both debug and production, emulator needs to draw the screen explicitly -if utils.EMULATOR or utils.INTERNAL_MODEL in ("T1B1", "T2B1"): - loop.after_step_hook = refresh - - # import style later to avoid circular dep from trezor.ui import style # isort:skip