From fe2cb9f9ca5f6b727d28d1d7436bc4a6f65b485f Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Wed, 24 Jan 2024 14:01:17 +0100 Subject: [PATCH] fixup! pane: Another stab at focus flickers in tab bar --- crates/workspace/src/pane.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crates/workspace/src/pane.rs b/crates/workspace/src/pane.rs index dd134576f5..ab8e248ac0 100644 --- a/crates/workspace/src/pane.rs +++ b/crates/workspace/src/pane.rs @@ -342,12 +342,10 @@ impl Pane { } pub fn has_focus(&self, cx: &WindowContext) -> bool { - // In addition to checking our own focus handle, - // we need to account for a brief moment (when active item is being switched) - // where we don't have focus. // We not only check whether our focus handle contains focus, but also // whether the active_item might have focus, because we might have just activated an item - // but that hasn't rendered yet. So before the next render, we might have transfered focus + // but that hasn't rendered yet. + // So before the next render, we might have transfered focus // to the item and `focus_handle.contains_focus` returns false because the `active_item` // is not hooked up to us in the dispatch tree. self.focus_handle.contains_focused(cx)