fix(deps): wrap the tray menu handler in an Arc for tray-icon 0.27
CI / Docker image (pull_request) Successful in 14s
CI / CLI (pull_request) Successful in 16s
CI / Server (pull_request) Successful in 24s
CI / CLI (linux-arm64, static) (pull_request) Successful in 50s
CI / CLI (linux-x86-64, static) (pull_request) Successful in 58s
CI / CLI (windows) (pull_request) Successful in 2m16s

tray-icon 0.27 pulls muda 0.22, where MenuEventHandler is Arc<dyn Fn(MenuEvent)> instead of a generic F: Fn(MenuEvent). Some(closure) no longer coerces through Option, so the handler is built as a typed Arc first.
This commit is contained in:
fristy committed 2026-11-25 16:39:16 +03:00
1 parent d3cbbc87a9
commit a8eec85be2
1 file changed
+3 -2
+3 -2
View File
@@ -75,10 +75,11 @@ pub fn start(wake: Sender<Wake>, repaint: Repaint, _runtime: &Handle) -> Result<
clicks.send(Wake::Toggle); clicks.send(Wake::Toggle);
} }
})); }));
MenuEvent::set_event_handler(Some(move |event: MenuEvent| { let on_menu: tray_icon::menu::MenuEventHandler = std::sync::Arc::new(move |event: MenuEvent| {
if *event.id() == open_id { notify.send(Wake::Show); } if *event.id() == open_id { notify.send(Wake::Show); }
else if *event.id() == quit_id { notify.send(Wake::Quit); } else if *event.id() == quit_id { notify.send(Wake::Quit); }
})); });
MenuEvent::set_event_handler(Some(on_menu));
Ok(Tray { _keep: Box::new(tray) }) Ok(Tray { _keep: Box::new(tray) })
} }