From d1fde927d2799211f791e7ea01cffb667c4f2b60 Mon Sep 17 00:00:00 2001 From: Vyacheslav Ananev <57404657+vnva@users.noreply.github.com> Date: Mon, 6 May 2024 19:05:57 +0700 Subject: [PATCH] systray: fix remove items (#1098) * systray: fix remove item * docs: add entry to CHANGELOG.md --- CHANGELOG.md | 1 + crates/eww/src/widgets/systray.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f5a6f1b..32e2aa82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ All notable changes to eww will be listed here, starting at changes since versio ### Fixes - Fix and refactor nix flake (By: w-lfchen) +- Fix remove items from systray (By: vnva) ### Features - Add `:truncate` property to labels, disabled by default (except in cases where truncation would be enabled in version `0.5.0` and before) (By: Rayzeq). diff --git a/crates/eww/src/widgets/systray.rs b/crates/eww/src/widgets/systray.rs index cf06907e..240a97f9 100644 --- a/crates/eww/src/widgets/systray.rs +++ b/crates/eww/src/widgets/systray.rs @@ -106,6 +106,7 @@ impl notifier_host::Host for Tray { fn remove_item(&mut self, id: &str) { if let Some(item) = self.items.get(id) { self.container.remove(&item.widget); + self.items.remove(id); } else { log::warn!("Tried to remove nonexistent item {:?} from systray", id); }