From 80c7745f5051bdad243b6ccc43d6e3b15572774a 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:43:18 +0000 Subject: [PATCH] workspace: Do not attempt to unnecessarily update jump list on worktree updates (#46882) (cherry-pick to preview) (#46886) Cherry-pick of #46882 to preview ---- 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 af8e274f6ed3b5a306f4b5247466c5f23c2078d1..6ed0fffe3dfbade5a062c9386e2910d39fbcb32f 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 => { @@ -6716,13 +6719,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(