From 429a558d782b30ecfd7b4a5b64488c2b68ebeb32 Mon Sep 17 00:00:00 2001 From: tychovrahe Date: Wed, 22 May 2024 22:30:46 +0200 Subject: [PATCH] fix(core): mercury ui animations only ask for frame on timer event [no changelog] --- .../src/ui/model_mercury/component/hold_to_confirm.rs | 9 ++++++--- .../rust/src/ui/model_mercury/component/status_screen.rs | 8 +++++--- .../src/ui/model_mercury/component/tap_to_confirm.rs | 8 +++++--- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/core/embed/rust/src/ui/model_mercury/component/hold_to_confirm.rs b/core/embed/rust/src/ui/model_mercury/component/hold_to_confirm.rs index 6ea0b1556f..ff29ba1f26 100644 --- a/core/embed/rust/src/ui/model_mercury/component/hold_to_confirm.rs +++ b/core/embed/rust/src/ui/model_mercury/component/hold_to_confirm.rs @@ -231,9 +231,12 @@ impl Component for HoldToConfirm { } _ => (), } - if self.anim.is_active() { - ctx.request_anim_frame(); - ctx.request_paint(); + + if let Event::Timer(EventCtx::ANIM_FRAME_TIMER) = event { + if self.anim.is_active() { + ctx.request_anim_frame(); + ctx.request_paint(); + } } None } diff --git a/core/embed/rust/src/ui/model_mercury/component/status_screen.rs b/core/embed/rust/src/ui/model_mercury/component/status_screen.rs index 0ee73362d8..4c6dfba12b 100644 --- a/core/embed/rust/src/ui/model_mercury/component/status_screen.rs +++ b/core/embed/rust/src/ui/model_mercury/component/status_screen.rs @@ -166,9 +166,11 @@ impl Component for StatusScreen { ctx.request_paint(); ctx.request_anim_frame(); } - if self.anim.is_active() { - ctx.request_anim_frame(); - ctx.request_paint(); + if let Event::Timer(EventCtx::ANIM_FRAME_TIMER) = event { + if self.anim.is_active() { + ctx.request_anim_frame(); + ctx.request_paint(); + } } match self.dismiss_type { diff --git a/core/embed/rust/src/ui/model_mercury/component/tap_to_confirm.rs b/core/embed/rust/src/ui/model_mercury/component/tap_to_confirm.rs index 237118d22e..4139ba0c82 100644 --- a/core/embed/rust/src/ui/model_mercury/component/tap_to_confirm.rs +++ b/core/embed/rust/src/ui/model_mercury/component/tap_to_confirm.rs @@ -179,9 +179,11 @@ impl Component for TapToConfirm { } _ => (), } - if self.anim.is_active() { - ctx.request_anim_frame(); - ctx.request_paint(); + if let Event::Timer(EventCtx::ANIM_FRAME_TIMER) = event { + if self.anim.is_active() { + ctx.request_anim_frame(); + ctx.request_paint(); + } } if self.anim.is_finished() { return Some(());