From 027f425804cbe0e7bd6f90ce36c5886fec4ae2c3 Mon Sep 17 00:00:00 2001 From: Thorsten Ball Date: Wed, 24 Jan 2024 11:47:59 +0100 Subject: [PATCH] Fix tab bar button's focus handling lagging behind This fixes https://github.com/zed-industries/community/issues/2442 for me. Previously, the tab bar buttons would stay when the chat panel was opened (and received focus) until something else was drawn (or caused a render?) With this change, the tab bar buttons are only shown if the pane was focus. I'm not sure about the side-effects of this, but the toolbar still seems to work fine. --- crates/workspace/src/pane.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/workspace/src/pane.rs b/crates/workspace/src/pane.rs index 10209f6e88..cc7eeb1a8a 100644 --- a/crates/workspace/src/pane.rs +++ b/crates/workspace/src/pane.rs @@ -1470,7 +1470,7 @@ impl Pane { ), ) }) - .when(self.was_focused || self.has_focus(cx), |tab_bar| { + .when(self.has_focus(cx), |tab_bar| { tab_bar.end_child({ let render_tab_buttons = self.render_tab_bar_buttons.clone(); render_tab_buttons(self, cx)