From 9ade399756c6224f6858ed5ea7a1ca212cbd5d86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Bergstr=C3=B6m?= Date: Thu, 7 Aug 2025 21:13:51 +0200 Subject: [PATCH] workspace: Don't update platform window title if title has not changed (#34753) Closes #34749 #34715 Release Notes: - Fixed window title X event spam --- crates/workspace/src/workspace.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs index 6572574ce1..aab8a36f45 100644 --- a/crates/workspace/src/workspace.rs +++ b/crates/workspace/src/workspace.rs @@ -1086,6 +1086,7 @@ pub struct Workspace { follower_states: HashMap, last_leaders_by_pane: HashMap, CollaboratorId>, window_edited: bool, + last_window_title: Option, dirty_items: HashMap, active_call: Option<(Entity, Vec)>, leader_updates_tx: mpsc::UnboundedSender<(PeerId, proto::UpdateFollowers)>, @@ -1418,6 +1419,7 @@ impl Workspace { last_leaders_by_pane: Default::default(), dispatching_keystrokes: Default::default(), window_edited: false, + last_window_title: None, dirty_items: Default::default(), active_call, database_id: workspace_id, @@ -4403,7 +4405,13 @@ impl Workspace { title.push_str(" ↗"); } + if let Some(last_title) = self.last_window_title.as_ref() { + if &title == last_title { + return; + } + } window.set_window_title(&title); + self.last_window_title = Some(title); } fn update_window_edited(&mut self, window: &mut Window, cx: &mut App) {