status-area: Handle clients that don't provide icon_name/icon_pixmap

It seems some clients expose the properties and leave them empty, but
others just provide either one on its own.

This fixes clients like Mattermost.
This commit is contained in:
Ian Douglas Scott 2024-03-27 13:53:01 -07:00 committed by Ian Douglas Scott
parent 4103b2e359
commit d5aa2f3252

View file

@ -33,10 +33,11 @@ impl StatusNotifierItem {
.build()
.await?;
let icon_name = item_proxy.icon_name().await?;
let icon_name = item_proxy.icon_name().await.unwrap_or_default();
let icon_pixmap = item_proxy
.icon_pixmap()
.await?
.await
.unwrap_or_default()
.into_iter()
.max_by_key(|i| (i.width, i.height))
.map(|mut i| {