From 95885daf4a1b819237e3a465fcb323e53704f812 Mon Sep 17 00:00:00 2001 From: eatradish Date: Mon, 12 Jan 2026 16:33:14 +0800 Subject: [PATCH] fix: ensure init gtk and build tray icon on same thread on linux... ... fix #33 --- src/gui/tray.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/tray.rs b/src/gui/tray.rs index 6dee67b..ce2458f 100644 --- a/src/gui/tray.rs +++ b/src/gui/tray.rs @@ -67,12 +67,14 @@ pub fn start_tray_handler( let bg_executor = async_app.background_executor().clone(); let bg_executor_clone = bg_executor.clone(); + #[cfg(not(target_os = "linux"))] start_tray_handler_inner(settings, tx, bg_executor_clone); #[cfg(target_os = "linux")] bg_executor .spawn(async move { gtk::init().expect("Failed to init gtk modules"); + start_tray_handler_inner(settings, tx, bg_executor_clone); gtk::main(); }) .detach();