workspace: Do not attempt to unnecessarily update jump list on worktree updates (#46882) (cherry-pick to stable) (#46887)

zed-zippy[bot] and Lukas Wirth created

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 <lukas@zed.dev>

Change summary

crates/workspace/src/workspace.rs | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)

Detailed changes

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(