feat: force QT_IM_MODULE=wayland for plugin process to enable Chinese…#433
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR ensures the tray plugin process always uses Qt’s native Wayland input method backend so IME (e.g., Chinese input) can be proxied correctly through the dockplugin compositor, while preserving and later restoring the original QT_IM_MODULE environment variable. Sequence diagram for plugin IME handling via Wayland text_inputsequenceDiagram
actor User
participant PluginProcess
participant DockpluginCompositor
participant OuterCompositor
participant IMEServer
User->>PluginProcess: Start tray plugin
PluginProcess->>PluginProcess: Save old QT_IM_MODULE
PluginProcess->>PluginProcess: qputenv QT_IM_MODULE=wayland
User->>PluginProcess: Focus input field and type characters
PluginProcess->>DockpluginCompositor: Wayland text_input events
DockpluginCompositor->>OuterCompositor: Proxy via zwp_text_input
OuterCompositor->>IMEServer: Forward IME requests
IMEServer-->>OuterCompositor: Composed text
OuterCompositor-->>DockpluginCompositor: Composed text result
DockpluginCompositor-->>PluginProcess: Inject committed text
PluginProcess-->>User: Chinese text appears in plugin UI
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Since you already capture the previous
QT_IM_MODULEinoldEnvs, consider only overriding it when it is unset or non-wayland to avoid surprising behavior for users who explicitly configured a different input method. - Double-check that this unconditional
QT_IM_MODULE=waylandexport only runs in Wayland/plugin contexts and won't affect any X11 or non-Wayland fallback paths, otherwise guard it with an appropriate platform/session check.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Since you already capture the previous `QT_IM_MODULE` in `oldEnvs`, consider only overriding it when it is unset or non-wayland to avoid surprising behavior for users who explicitly configured a different input method.
- Double-check that this unconditional `QT_IM_MODULE=wayland` export only runs in Wayland/plugin contexts and won't affect any X11 or non-Wayland fallback paths, otherwise guard it with an appropriate platform/session check.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
065d83b to
09f94e0
Compare
09f94e0 to
96d0943
Compare
… input The plugin process connects to the internal dockplugin compositor and cannot directly access the system fcitx/ibus DBus interfaces. Force the use of the native Wayland text_input protocol so that IME requests are properly proxied by the dockplugin compositor (via zwp_text_input) to the outer real compositor, enabling Chinese input in plugin windows. feat: force QT_IM_MODULE=wayland for plugin process to enable Chinese input Pms: BUG-323547
96d0943 to
d9c815b
Compare
deepin pr auto review这段代码的修改主要涉及版权年份的更新以及在 Wayland 环境下对输入法模块(Input Method, IM)行为的调整。以下是对这段 diff 的详细审查意见,涵盖语法逻辑、代码质量、代码性能和代码安全四个方面: 1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
改进建议虽然代码本身没有明显错误,但为了进一步提升健壮性,可以考虑以下建议:
总结这段代码修改逻辑清晰,注释详尽,解决了特定架构下的输入法通信问题,且未引入明显的性能或安全隐患。建议重点确认环境变量恢复策略以及平台适用性检查的完整性。 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: BLumia, yixinshark The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/forcemerge |
|
This pr force merged! (status: blocked) |
… input
The plugin process connects to the internal dockplugin compositor and cannot directly access the system fcitx/ibus DBus interfaces. Force the use of the native Wayland text_input protocol so that IME requests are properly proxied by the dockplugin compositor (via zwp_text_input) to the outer real compositor, enabling Chinese input in plugin windows.
feat: force QT_IM_MODULE=wayland for plugin process to enable Chinese input
Pms: BUG-323547
Summary by Sourcery
Bug Fixes: