From 4b351b4d59cabdc4f58e614e21f763017df49661 Mon Sep 17 00:00:00 2001 From: "zed-zippy[bot]" <234243425+zed-zippy[bot]@users.noreply.github.com> Date: Thu, 15 Jan 2026 11:41:38 +0000 Subject: [PATCH] workspace: Do not attempt to unnecessarily update jump list on worktree updates (#46882) (cherry-pick to stable) (#46887) Cherry-pick of #46882 to stable ---- 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 ... Co-authored-by: Lukas Wirth --- 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 e82ab432b42ae637030532a243de72d5df2558d9..bbd9999090b7b51bc4e2f26804c81479874b5338 100644 --- a/crates/workspace/src/workspace.rs +++ b/crates/workspace/src/workspace.rs @@ -1283,12 +1283,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 => { @@ -6606,13 +6609,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(