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 <hello@anthonyeid.me>
This commit is contained in:
Piotr Osiewicz 2025-04-01 18:33:52 +02:00 committed by GitHub
parent 7257053df4
commit 992831ceb6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -565,7 +565,7 @@ impl Dock {
pub fn restore_state(&mut self, window: &mut Window, cx: &mut Context<Self>) -> 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);
}