feat(selection-polish): Linux 支持——fcitx5 插件热键路由 + PRIMARY 选区校验 - #927
Merged
Conversation
Collaborator
Author
|
重新触发 CI(checks 未注册) |
- linux_fcitx.rs:新增 SetSelectionPolishHotkeyRaw DBus 方法 + sync_selection_polish_binding; start_dictation_signal_listener 增加 selection_polish_trigger 参数,监听 SelectionPolishEvent 信号 → HotkeyEvent::SelectionPolishShortcutPressed, 初始同步与 fcitx5 重启重同步均含选区润色触发键 - hotkey.rs Linux adapter:update_modifier_shortcuts 转发 selection_polish_trigger (移除 disabled on Linux 注释) - hotkey_loops.rs:Linux 启动 fcitx5 监听时传入 selection_polish_trigger - selection.rs Linux 分支:is_captured = PRIMARY 读到选区即可;validate 重读 PRIMARY 与捕获文本比较(用户改选/清空即拒绝粘贴);selection_text_matches cfg 覆盖 linux - fcitx5 插件 openless.cpp:新增 SelectionPolishEvent 信号 + SetSelectionPolishHotkeyRaw 方法(INI 持久化 SelectionPolishRawSym/States), 按键分发仿 QA 模式;需重装插件(scripts/inject-fcitx5-plugin.sh)生效 - 注:Linux 代码由 Linux CI 验证编译;fcitx 插件 .so 需 Linux 环境重编译安装
appergb
force-pushed
the
feat/selection-polish-linux
branch
from
August 5, 2026 21:37
020fedf to
2f6f4c5
Compare
coordinator.rs 的 hotkey 安装路径调 start_dictation_signal_listener 时漏传 selection_polish_trigger(签名 7 参数只传 6 个),Linux CI E0061。hotkey_loops.rs 已传,此处遗漏导致 Linux 编译失败。
H-Chris233
added a commit
to bigsongeth/openless
that referenced
this pull request
Aug 6, 2026
…with Open-Less#924 omni/Open-Less#927 selection-polish/Open-Less#928 local-asr)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
目标
补齐 Linux 端选中润色:fcitx5 插件新增选区润色触发键信号路由(仿 QA 模式),Rust 侧同步 + 转发,选区插入前用 PRIMARY selection 重读做安全校验。与 Windows/macOS 保持一致(触发键 → 润色 → 替换选区)。
改动
src-tauri/src/linux_fcitx.rs:SetSelectionPolishHotkeyRawDBus 方法 +sync_selection_polish_binding;start_dictation_signal_listener新增selection_polish_trigger参数,SelectionPolishEvent信号 →HotkeyEvent::SelectionPolishShortcutPressed;初始同步与 fcitx5 重启重同步均含选区润色触发键src-tauri/src/hotkey.rs:Linux adapterupdate_modifier_shortcuts转发 selection_polish_trigger(移除 disabled 注释)src-tauri/src/coordinator/hotkey_loops.rs:Linux 启动 fcitx5 监听时传入 selection_polish_triggersrc-tauri/src/selection.rs:Linux 分支is_captured= PRIMARY 读到选区即可开始;validate重读 PRIMARY 与捕获文本比较(用户改选/清空 PRIMARY 即拒绝粘贴);selection_text_matchescfg 覆盖 linuxscripts/linux-fcitx5-plugin/openless.cpp:SelectionPolishEvent信号 +SetSelectionPolishHotkeyRaw方法(INI 持久化 SelectionPolishRawSym/States),按键分发仿 QA 模式兼容性
scripts/inject-fcitx5-plugin.sh)后生效;Linux 上默认无触发键(用户可在设置里配置 modifier-only 键,如右 Alt)测试
cargo test(940 pass)+npm run build确认改动不破坏其他平台(Linux 分支代码由 Linux CI 编译验证)已知限制
scripts/inject-fcitx5-plugin.sh