From 8efebe9342a7d2029ab58c5b8f022b4afdc186fe Mon Sep 17 00:00:00 2001 From: Steven Malis Date: Sun, 1 Dec 2024 12:42:25 -0500 Subject: [PATCH 1/2] Do not propagate_to_hidden RouteFocusChanged events Hidden widgets can't have focus, so they don't need to know about focus changes. --- druid/src/event.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/druid/src/event.rs b/druid/src/event.rs index f89b11e68..9f9a929bc 100644 --- a/druid/src/event.rs +++ b/druid/src/event.rs @@ -500,9 +500,9 @@ impl InternalLifeCycle { pub fn should_propagate_to_hidden(&self) -> bool { match self { InternalLifeCycle::RouteWidgetAdded - | InternalLifeCycle::RouteFocusChanged { .. } | InternalLifeCycle::RouteDisabledChanged => true, - InternalLifeCycle::RouteViewContextChanged { .. } => false, + InternalLifeCycle::RouteViewContextChanged { .. } + | InternalLifeCycle::RouteFocusChanged { .. } => false, InternalLifeCycle::DebugRequestState { .. } | InternalLifeCycle::DebugRequestDebugState { .. } | InternalLifeCycle::DebugInspectState(_) => true, From d13e020b1613272940cfe688ddb0c19b5695305e Mon Sep 17 00:00:00 2001 From: Steven Malis Date: Sun, 1 Dec 2024 13:03:53 -0500 Subject: [PATCH 2/2] Fmt --- druid/src/event.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/druid/src/event.rs b/druid/src/event.rs index 9f9a929bc..8a719f5c9 100644 --- a/druid/src/event.rs +++ b/druid/src/event.rs @@ -499,8 +499,7 @@ impl InternalLifeCycle { /// [`Event::should_propagate_to_hidden`]: Event::should_propagate_to_hidden pub fn should_propagate_to_hidden(&self) -> bool { match self { - InternalLifeCycle::RouteWidgetAdded - | InternalLifeCycle::RouteDisabledChanged => true, + InternalLifeCycle::RouteWidgetAdded | InternalLifeCycle::RouteDisabledChanged => true, InternalLifeCycle::RouteViewContextChanged { .. } | InternalLifeCycle::RouteFocusChanged { .. } => false, InternalLifeCycle::DebugRequestState { .. }