feat(linux): fcitx5 plugin for Wayland input + deb packaging#451
Conversation
PR Reviewer Guide 🔍(Review updated until commit 39ce12c)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 |
|
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 |
|
我不认为这是bug,用户应该在输入时自行把光标放在准备输入的位置 |
|
@claude 审查他的代码,主要关注以下问题: 1.他主要对哪些方向进行了更改? |
claude似乎没有反应,你再试一遍? |
|
@claude 审查他的代码,主要关注以下问题: 1.他主要对哪些方向进行了更改? |
1 similar comment
|
@claude 审查他的代码,主要关注以下问题: 1.他主要对哪些方向进行了更改? |
|
claude运行似乎出现了错误 |
PR #451 (来自 fork aeoform/openless, head ref 也叫 beta) 触发 @claude 时, claude-code-action 执行 `git fetch origin pull/451/head:beta` 把 PR head 拉到本地 beta 分支,但此时 worktree 正 checkout 在 refs/heads/beta, git 拒绝 fetch 到已 checkout 的分支: fatal: refusing to fetch into branch 'refs/heads/beta' checked out at ... Action failed with error: Command failed: git fetch origin --depth=20 pull/451/head:beta 修复: 在 actions/checkout 后立即 git checkout --detach,释放 refs/heads/<default-branch> 这个本地分支名,让 action 自己 fetch 不撞名. 仅在 fork head ref == base ref name 的 corner case 才会触发问题, detach 对其他场景无副作用. 失败 run: https://github.com/Open-Less/openless/actions/runs/25978532215 Co-authored-by: baiqing <lbx12309@icloud.com>
|
@claude 审查一下他主要更改了哪些部分,是否会在其他平台上造成问题。 |
…nator.rs conflict - Accept upstream's show_capsule_window_for_recording wrapper + CapsuleShowStrategy (our Linux fallback logic is subsumed by the upstream strategy pattern) - Keep Linux on NoActivate strategy; show_capsule_window_no_activate returns true on Linux to suppress capsule window (no popup on Wayland/fcitx5) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Persistent review updated to latest commit 39ce12c |
PR #451 (fcitx5 plugin) 把 Linux 加进 capsule_show_strategy_for_platform 的 NoActivate 分支,但漏改单元测试 capsule_show_strategy_matches_ platform_activation_contract 的 cfg —— 测试断言 Linux 还应该是 FallbackShow,结果 Linux CI red(Run Rust backend unit tests panicked at coordinator.rs:3617)。 修法:测试的两组 #[cfg] 同步 Linux。同时在实现函数前加显式提示 注释:改 cfg 列表必须同步更新对应测试,防止下次再漏。 cargo test --lib capsule_show_strategy 本地通过。
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
fcitx5DBus pluginCommit dictation text via
CommitTextSync hotkeys and modifier triggers
Remove Wayland-only
rdevpathsDiagram Walkthrough
File Walkthrough
11 files
Replace Linux rdev hotkey listenerAdd fcitx5 DBus client and sync helpersStart plugin listener and sync bindingsRoute Linux Unicode input through pluginPrefer fcitx5 commit with clipboard fallbackGate Linux fcitx module at runtimeRename Linux adapter to fcitx5Implement fcitx5 plugin DBus interfaceUpdate frontend adapter type unionRemove Wayland callout from settingsMap adapter label to fcitx51 files
Simplify Linux insertion and error paths1 files
Remove rdev and add Linux dbus4 files
Add standalone plugin build scriptDefine plugin build and install rulesAdd fcitx5 addon metadata templateBundle fcitx5 plugin into Linux releases3 files
Refresh Linux streaming input hintsUpdate English Linux and adapter copyUpdate Simplified Chinese Linux copy7 files