From dfced4ff1d0f0dbe2cf689d6b56693512c3c4a38 Mon Sep 17 00:00:00 2001 From: aeoform <2790848120@qq.com> Date: Sat, 16 May 2026 00:08:42 +0800 Subject: [PATCH] fix(linux): sync fcitx5 plugin hotkey binding on update When ensure_modifier_hotkey_monitor finds an existing monitor and updates the rdev/CGEventTap binding, it must also sync the new binding to the fcitx5 plugin on Wayland. Previously the early return skipped this, leaving plugin and coordinator out of sync after a hotkey change. Co-Authored-By: Claude Opus 4.7 --- openless-all/app/src-tauri/src/coordinator.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/openless-all/app/src-tauri/src/coordinator.rs b/openless-all/app/src-tauri/src/coordinator.rs index c710cced..fd3bb193 100644 --- a/openless-all/app/src-tauri/src/coordinator.rs +++ b/openless-all/app/src-tauri/src/coordinator.rs @@ -704,7 +704,15 @@ impl Coordinator { fn ensure_modifier_hotkey_monitor(&self, binding: crate::types::HotkeyBinding) { if let Some(monitor) = self.inner.hotkey.lock().as_ref() { + // 先 clone 再 move,确保 fcitx5 插件也能同步到新热键。 + #[cfg(target_os = "linux")] + let plugin_binding = binding.clone(); monitor.update_binding(binding); + // Wayland: 同步新热键到 fcitx5 插件(rdev 路径已由 update_binding 更新)。 + #[cfg(target_os = "linux")] + if crate::hotkey::is_wayland_session() { + crate::linux_fcitx::sync_binding_to_plugin(&plugin_binding); + } return; } let (tx, rx) = mpsc::channel::();