From 8016ec256de0c3d2290d1446cda45a769a3c5284 Mon Sep 17 00:00:00 2001 From: Jake Stanger Date: Sat, 27 Jan 2024 00:35:16 +0000 Subject: [PATCH] fix(tray): crash caused by excess updates Some icons seem to absolutely spam updates in some circumstances. Increasing the channel size by 4x seems sufficient to prevent this. --- src/clients/system_tray.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/clients/system_tray.rs b/src/clients/system_tray.rs index 60c8b12..aec5c0a 100644 --- a/src/clients/system_tray.rs +++ b/src/clients/system_tray.rs @@ -25,7 +25,7 @@ impl TrayEventReceiver { let id = format!("ironbar-{}", Ironbar::unique_id()); let (tx, rx) = mpsc::channel(16); - let (b_tx, b_rx) = broadcast::channel(16); + let (b_tx, b_rx) = broadcast::channel(64); let tray = StatusNotifierWatcher::new(rx).await?; let mut host = Box::pin(tray.create_notifier_host(&id)).await?; @@ -48,7 +48,7 @@ impl TrayEventReceiver { item, menu, } => { - debug!("Adding item with address '{address}'"); + debug!("Adding/updating item with address '{address}'"); tray.insert(address, (item, menu)); } NotifierItemMessage::Remove { address } => {