From 11a0107e97a628d7894b4a57c8cb4cc88ea1e365 Mon Sep 17 00:00:00 2001 From: bunnie Date: Wed, 9 Nov 2022 00:33:13 +0800 Subject: [PATCH] fix UX state after button press on dynamic modal This bug was hidden by the previous return of state before the reliquish. Now with the correct ordering, we end up getting a double-relinquish which ends up trying to swap a modal into focus which doesn't exist. This fixes that edge case --- services/gam/src/modal/notification.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/services/gam/src/modal/notification.rs b/services/gam/src/modal/notification.rs index 7f3865417..1a662e091 100644 --- a/services/gam/src/modal/notification.rs +++ b/services/gam/src/modal/notification.rs @@ -194,8 +194,10 @@ impl ActionApi for Notification { } _ => { // relinquish focus before returning the result - self.gam.relinquish_focus().unwrap(); - xous::yield_slice(); + if self.manual_dismiss { + self.gam.relinquish_focus().unwrap(); + xous::yield_slice(); + } send_message( self.action_conn,