Fix zoomed dock closing on window reactivation (#46972)

Fixes https://github.com/zed-industries/zed/issues/46953

This bug fix cost $10

Release Notes:

- N/A

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Mikayla MakiandClaude Opus 4.5 authored and GitHub committed 2026-01-16 08:40:16 +00:00
1 parent 530f4ed6e2
commit 9f9f38cabd
1 file changed
+15 -1
+15 -1
View File
@@ -4372,7 +4372,21 @@ impl Workspace {
self.last_active_center_pane = Some(pane.downgrade());
}
self.dismiss_zoomed_items_to_reveal(None, window, cx);
// If this pane is in a dock, preserve that dock when dismissing zoomed items.
// This prevents the dock from closing when focus events fire during window activation.
let dock_to_preserve = self.all_docks().iter().find_map(|dock| {
let dock_read = dock.read(cx);
if let Some(panel) = dock_read.active_panel()
&& let Some(dock_pane) = panel.pane(cx)
&& dock_pane == pane
{
Some(dock_read.position())
} else {
None
}
});
self.dismiss_zoomed_items_to_reveal(dock_to_preserve, window, cx);
if pane.read(cx).is_zoomed() {
self.zoomed = Some(pane.downgrade().into());
} else {