status-area: Don't add duplicate status item

Some clients seem to have issues with this.
This commit is contained in:
Ian Douglas Scott 2026-01-27 14:32:44 -08:00
parent ebe18a17c5
commit 6e99ad42b5

View file

@ -37,12 +37,16 @@ impl StatusNotifierWatcher {
} else { } else {
service.to_string() service.to_string()
}; };
// Ignore duplicate
if !self.items.iter().any(|(a, b)| (a, b) == (sender, &service)) {
Self::status_notifier_item_registered(&ctxt, &service) Self::status_notifier_item_registered(&ctxt, &service)
.await .await
.unwrap(); .unwrap();
self.items.push((sender.to_owned(), service)); self.items.push((sender.to_owned(), service));
} }
}
fn register_status_notifier_host(&self, _service: &str) { fn register_status_notifier_host(&self, _service: &str) {
// XXX emit registed/unregistered // XXX emit registed/unregistered