From 1321aa932ca5975e968023f698b8b610711d48be Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Thu, 15 Jan 2026 12:29:40 +0100 Subject: [PATCH] workspace: Do not attempt to unnecessarily update jump list on worktree updates (#46882) It should be a no-op but causes massive main thread hangs on windows due to the winapi calls this emits, restores the behavior pre github.com/zed-industries/zed/pull/46256 without reverting the main changes of that. Release Notes: - N/A *or* Added/Fixed/Improved ... --- crates/workspace/src/workspace.rs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs index 4dad00f158644a7c59bee057ac49c5c4be97dbfd..5a8011bb3579f02cf6d35b764becc4178f16b68a 100644 --- a/crates/workspace/src/workspace.rs +++ b/crates/workspace/src/workspace.rs @@ -1303,12 +1303,15 @@ impl Workspace { this.collaborator_left(*peer_id, window, cx); } - project::Event::WorktreeRemoved(_) => { - this.update_worktree_data(window, cx); + project::Event::WorktreeRemoved(_) | project::Event::WorktreeAdded(..) => { + this.update_window_title(window, cx); + this.serialize_workspace(window, cx); + this.update_history(cx); } - project::Event::WorktreeUpdatedEntries(..) | project::Event::WorktreeAdded(..) => { - this.update_worktree_data(window, cx); + project::Event::WorktreeUpdatedEntries(..) => { + this.update_window_title(window, cx); + this.serialize_workspace(window, cx); } project::Event::DisconnectedFromHost => { @@ -6731,13 +6734,6 @@ impl Workspace { } } } - - fn update_worktree_data(&mut self, window: &mut Window, cx: &mut Context<'_, Self>) { - self.update_window_title(window, cx); - self.serialize_workspace(window, cx); - // This event could be triggered by `AddFolderToProject` or `RemoveFromProject`. - self.update_history(cx); - } } fn leader_border_for_pane(