fix(tray): image updates lag 1 behind

This commit is contained in:
Jake Stanger 2024-11-08 01:35:35 +00:00
parent 55c0940e1d
commit fb1799531b
No known key found for this signature in database
GPG Key ID: C51FC8F9CB0BEA61
2 changed files with 2 additions and 3 deletions

View File

@ -148,8 +148,8 @@ futures-signals = { version = "0.3.34", optional = true }
sysinfo = { version = "0.29.11", optional = true }
# tray
system-tray = { version = "0.2.0", optional = true }
system-tray = { version = "0.3.0", optional = true }
png = { version = "0.17.14", optional = true }
# upower
upower_dbus = { version = "0.3.2", optional = true }

View File

@ -211,13 +211,12 @@ fn on_update(
}
UpdateEvent::Icon(icon) => {
if icon.as_ref() != menu_item.icon_name() {
menu_item.set_icon_name(icon);
match icon::get_image(menu_item, icon_theme, icon_size, prefer_icons) {
Ok(image) => menu_item.set_image(&image),
Err(_) => menu_item.show_label(),
};
}
menu_item.set_icon_name(icon);
}
UpdateEvent::OverlayIcon(_icon) => {
warn!("received unimplemented NewOverlayIcon event");