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,11 +37,15 @@ impl StatusNotifierWatcher {
} else {
service.to_string()
};
Self::status_notifier_item_registered(&ctxt, &service)
.await
.unwrap();
self.items.push((sender.to_owned(), service));
// Ignore duplicate
if !self.items.iter().any(|(a, b)| (a, b) == (sender, &service)) {
Self::status_notifier_item_registered(&ctxt, &service)
.await
.unwrap();
self.items.push((sender.to_owned(), service));
}
}
fn register_status_notifier_host(&self, _service: &str) {