From 992831ceb6e3d5babc125abf8dd39a75951f1a5a Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Tue, 1 Apr 2025 18:33:52 +0200 Subject: [PATCH] workspace: Do not call set_active when deserializing a dock if that dock was not visible (#27852) This unblocks work on new debugger UI, where we don't want the set_active function to be called unconditionally. Release Notes: - N/A --------- Co-authored-by: Anthony Eid --- crates/workspace/src/dock.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/workspace/src/dock.rs b/crates/workspace/src/dock.rs index ddd509466f1098479bbf18eb008d9ff34d74022f..26612892ccff506985ac10964d94e081abe22c9f 100644 --- a/crates/workspace/src/dock.rs +++ b/crates/workspace/src/dock.rs @@ -565,7 +565,7 @@ impl Dock { pub fn restore_state(&mut self, window: &mut Window, cx: &mut Context) -> bool { if let Some(serialized) = self.serialized_dock.clone() { - if let Some(active_panel) = serialized.active_panel { + if let Some(active_panel) = serialized.active_panel.filter(|_| serialized.visible) { if let Some(idx) = self.panel_index_for_persistent_name(active_panel.as_str(), cx) { self.activate_panel(idx, window, cx); }