From 8a6934e844e82bb56ae8befc593f00a35040c092 Mon Sep 17 00:00:00 2001 From: grdddj Date: Wed, 22 Nov 2023 14:56:46 +0100 Subject: [PATCH] fix(core): completely repaint layouts before showing them in a loop [no changelog] --- core/src/trezor/ui/layouts/tr/__init__.py | 3 +++ core/src/trezor/ui/layouts/tt/__init__.py | 23 ++++++++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/core/src/trezor/ui/layouts/tr/__init__.py b/core/src/trezor/ui/layouts/tr/__init__.py index e0bfcf6ab6..d8e6a49b66 100644 --- a/core/src/trezor/ui/layouts/tr/__init__.py +++ b/core/src/trezor/ui/layouts/tr/__init__.py @@ -495,6 +495,7 @@ async def show_address( br_code, pages=layout.page_count(), ) + layout.request_complete_repaint() result = await ctx_wait(layout) # User confirmed with middle button. @@ -1106,6 +1107,7 @@ async def confirm_modify_output( ButtonRequestType.ConfirmOutput, address_layout.page_count(), ) + address_layout.request_complete_repaint() await raise_if_not_confirmed(ctx_wait(address_layout)) if send_button_request: @@ -1115,6 +1117,7 @@ async def confirm_modify_output( ButtonRequestType.ConfirmOutput, modify_layout.page_count(), ) + modify_layout.request_complete_repaint() result = await ctx_wait(modify_layout) if result is CONFIRMED: diff --git a/core/src/trezor/ui/layouts/tt/__init__.py b/core/src/trezor/ui/layouts/tt/__init__.py index 0e63760df4..09b6639ce3 100644 --- a/core/src/trezor/ui/layouts/tt/__init__.py +++ b/core/src/trezor/ui/layouts/tt/__init__.py @@ -429,16 +429,18 @@ async def show_address( details_title = "RECEIVING TO" elif details_title is None: details_title = title - while True: - layout = RustLayout( - trezorui2.confirm_address( - title=title, - data=address, - description=network or "", - extra=None, - chunkify=chunkify, - ) + + layout = RustLayout( + trezorui2.confirm_address( + title=title, + data=address, + description=network or "", + extra=None, + chunkify=chunkify, ) + ) + + while True: if send_button_request: send_button_request = False await button_request( @@ -446,6 +448,7 @@ async def show_address( br_code, pages=layout.page_count(), ) + layout.request_complete_repaint() result = await ctx_wait(layout) # User pressed right button. @@ -1059,6 +1062,7 @@ async def confirm_modify_output( ButtonRequestType.ConfirmOutput, address_layout.page_count(), ) + address_layout.request_complete_repaint() await raise_if_not_confirmed(ctx_wait(address_layout)) if send_button_request: @@ -1068,6 +1072,7 @@ async def confirm_modify_output( ButtonRequestType.ConfirmOutput, modify_layout.page_count(), ) + modify_layout.request_complete_repaint() result = await ctx_wait(modify_layout) if result is CONFIRMED: