mirror of
https://github.com/zed-industries/zed.git
synced 2024-10-26 00:19:46 +00:00
fixup! pane: Another stab at focus flickers in tab bar
This commit is contained in:
parent
0497b2f212
commit
fe2cb9f9ca
1 changed files with 2 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue