feat(linux): fcitx5 plugin for Wayland input + deb packaging#451
feat(linux): fcitx5 plugin for Wayland input + deb packaging#451aeoform wants to merge 15 commits into
Conversation
PR Reviewer Guide 🔍(Review updated until commit f043176)Here are some key observations to aid the review process:
|
|
已修复 stale sync 问题:
其他两个 review 点:
|
|
Persistent review updated to latest commit 265babd |
|
后续我会考虑加上其他的输入法版本。 |
|
已修复安装路径问题:cmake 运行时通过 关于 savedIc_ 野指针:
|
|
Persistent review updated to latest commit e7cfc14 |
|
Persistent review updated to latest commit 9e81339 |
|
Persistent review updated to latest commit 1802ed7 |
Linux 统一走 fcitx5 输入法的决策说明最新提交(dce03b6)移除了 Linux 上的 enigo XTest 路径,X11 也和 Wayland 一样统一走 fcitx5 插件 CommitText 直写。 原因:
降级保障:
AppImage:
|
|
Persistent review updated to latest commit dce03b6 |
- fcitx5 C++ plugin (scripts/linux-fcitx5-plugin/) with DBus interface: CommitText, SetHotkey/SetHotkeyRaw, DictationKeyEvent signal - linux_fcitx.rs: DBus client to call plugin from Rust - coordinator/dictation.rs: Wayland insertion via fcitx5 commit_text, streaming insert enabled on Wayland - insertion.rs: fcitx5 commit_text on Linux with clipboard fallback - unicode_keystroke.rs: Linux path uses fcitx5 commit_text - Capsule window show-once on Linux to avoid stealing focus Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add #[cfg(target_os = "linux")] to mod linux_fcitx to fix macOS/Windows CI compilation (dbus crate is Linux-only). - Wayland: skip capsule window show/hide entirely in emit_capsule so the target app never loses keyboard focus. Text is committed via fcitx5 plugin commit_string — no window means the compositor forwards the commit to the right app. - X11 keeps existing behavior (show capsule window once per session). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add "Build fcitx5 plugin" step to release-tauri.yml: compiles the C++ plugin via cmake, copies .so + .conf to src-tauri/linux-fcitx5-plugin/ for the Tauri bundler. - Override tauri build --config to include deb.files / rpm.files that place the plugin at /usr/lib/fcitx5/ so it's auto-detected after install. - Add fcitx5, fcitx5-module-dbus as deb/rpm dependencies. - Local builds unaffected (config is CI-only via --config flag). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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 <noreply@anthropic.com>
FCITX_INSTALL_ADDONDIR varies by distro (multiarch Ubuntu → /usr/lib/x86_64-linux-gnu/fcitx5/; Fedora → /usr/lib64/fcitx5/; Arch → /usr/lib/fcitx5/). Extract from cmake cache at build time via GITHUB_ENV instead of hardcoding. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Prevents savedIc_ from becoming a dangling pointer by connecting to the InputContext::destroyed signal when the IC is saved. On destruction the pointer is cleared automatically, and commitText falls through to foreachFocused for the current focused IC. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…syntax ic->connect(ic->destroyed, ...) is invalid — InputContext has no two-arg connect overload. Use ic->destroyed.connect(callback) directly, which calls Signal<void()>::connect. Also simplified ScopedConnection storage from unique_ptr to direct member (ScopedConnection is move-assignable). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
fcitx5 插件 Wayland/X11 都可使用,不再为 X11 单独维护 enigo XTest。 Linux 统一走 fcitx5 CommitText 直写,插件不可用时降级到剪贴板拷贝。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Remove 290 lines of unused rdev listener code from the Linux hotkey platform module, drop the rdev dependency from Cargo.toml, and clean up capsule_window_visible init leftover. Update doc comments and frontend i18n to reflect the unified fcitx5-only path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Persistent review updated to latest commit b349a4d |
…plugin Extend the fcitx5 plugin with SetQaHotkeyRaw/SetTranslationHotkeyRaw DBus methods and corresponding signals, so that QA panel toggle and translation modifier hotkeys work on Linux (not just the main dictation hotkey). Built-in Shift key translation modifier also handled by the plugin. Document DBus security model in plugin header. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Persistent review updated to latest commit 323dbed |
- Add SetCustomDictationTrigger(s) to plugin for custom key combos - Add fcitx5 availability check before hotkey install, surface error - Sync custom dictation combo to fcitx5 plugin from coordinator Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Persistent review updated to latest commit 60250c8 |
Map Debian multiarch addon dir to /usr/lib64 for RPM packages. Uses FCITX_RPM_ADDON_DIR derived from cmake output instead of hardcoded paths. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Persistent review updated to latest commit 088e2ab |
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Persistent review updated to latest commit 47f2f7b |
|
Persistent review updated to latest commit 416da60 |
…om combo and preset modifier setHotkey/setHotkeyRaw now clear hasCustomDictationKey_ to prevent stale custom combo from persisting after switching to a preset modifier. setCustomDictationTrigger now persists TriggerRawSym=TriggerRawStates=0 to raw config so the old raw trigger doesn't reload after fcitx5 restart. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Persistent review updated to latest commit 9cd8b9a |
|
我这里没有Fn键,我不能确定是否有问题,需要有人帮忙测试一下 |
Fn key does not generate a standard X11 keysym on Linux. The previous mapping to Super_L (0xffeb) was incorrect and would bind the Windows/Super key instead. Map to RightControl (0xffe4) to match the existing fallback convention used on Windows (VK_RCONTROL) and in the coordinator's hotkey matching logic. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
已修复:
commit: f043176 |
|
Persistent review updated to latest commit f043176 |
User description
Summary
scripts/linux-fcitx5-plugin/): DBus interface with CommitText, SetHotkey/SetHotkeyRaw/SetQaHotkeyRaw/SetTranslationHotkeyRaw methods and DictationKeyEvent/QaShortcutEvent/TranslationModifierEvent signals. Replaces enigo/XTest for Wayland and X11 compatibility.Test plan
PR Type
Enhancement, Bug fix
Description
Add Linux fcitx5 DBus plugin
Prefer plugin commits over Linux fallback
Remove Wayland-only hotkey and capsule paths
Update packaging, UI, and locales
Diagram Walkthrough
File Walkthrough
14 files
Switch Linux hotkeys to fcitx5 adapterAdd DBus client and signal bridgeSync Linux bindings and launch listenerCommit Linux text through fcitx5Rename hotkey adapter to fcitx5Remove Wayland-only hotkey calloutUpdate Japanese Linux hotkey labelsUpdate Traditional Chinese Linux labelsUpdate Korean Linux hotkey labelsUpdate Simplified Chinese Linux labelsUpdate English Linux hotkey labelsShow fcitx5 adapter nameRename frontend adapter typeImplement fcitx5 OpenLess addon2 files
Drop Wayland gating from insert flowPrefer fcitx5 commit before fallback5 files
Gate Linux module registrationAdd plugin build helper scriptBundle fcitx5 plugin into releasesAdd fcitx5 plugin build targetsDefine fcitx5 addon metadata3 files
Simplify Linux selection platform notesRewrite Linux trigger path documentationRevise Linux streaming insertion hint1 files
Add Linux DBus dependency2 files
Clean up obsolete Linux command exportsRemove stale Wayland IPC helpers