workspace: Don't update platform window title if title has not changed (#34753)
Closes #34749 #34715 Release Notes: - Fixed window title X event spam
This commit is contained in:
parent
e8db429d24
commit
9ade399756
1 changed files with 8 additions and 0 deletions
|
@ -1086,6 +1086,7 @@ pub struct Workspace {
|
||||||
follower_states: HashMap<CollaboratorId, FollowerState>,
|
follower_states: HashMap<CollaboratorId, FollowerState>,
|
||||||
last_leaders_by_pane: HashMap<WeakEntity<Pane>, CollaboratorId>,
|
last_leaders_by_pane: HashMap<WeakEntity<Pane>, CollaboratorId>,
|
||||||
window_edited: bool,
|
window_edited: bool,
|
||||||
|
last_window_title: Option<String>,
|
||||||
dirty_items: HashMap<EntityId, Subscription>,
|
dirty_items: HashMap<EntityId, Subscription>,
|
||||||
active_call: Option<(Entity<ActiveCall>, Vec<Subscription>)>,
|
active_call: Option<(Entity<ActiveCall>, Vec<Subscription>)>,
|
||||||
leader_updates_tx: mpsc::UnboundedSender<(PeerId, proto::UpdateFollowers)>,
|
leader_updates_tx: mpsc::UnboundedSender<(PeerId, proto::UpdateFollowers)>,
|
||||||
|
@ -1418,6 +1419,7 @@ impl Workspace {
|
||||||
last_leaders_by_pane: Default::default(),
|
last_leaders_by_pane: Default::default(),
|
||||||
dispatching_keystrokes: Default::default(),
|
dispatching_keystrokes: Default::default(),
|
||||||
window_edited: false,
|
window_edited: false,
|
||||||
|
last_window_title: None,
|
||||||
dirty_items: Default::default(),
|
dirty_items: Default::default(),
|
||||||
active_call,
|
active_call,
|
||||||
database_id: workspace_id,
|
database_id: workspace_id,
|
||||||
|
@ -4403,7 +4405,13 @@ impl Workspace {
|
||||||
title.push_str(" ↗");
|
title.push_str(" ↗");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Some(last_title) = self.last_window_title.as_ref() {
|
||||||
|
if &title == last_title {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
window.set_window_title(&title);
|
window.set_window_title(&title);
|
||||||
|
self.last_window_title = Some(title);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update_window_edited(&mut self, window: &mut Window, cx: &mut App) {
|
fn update_window_edited(&mut self, window: &mut Window, cx: &mut App) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue