fix: set focus to search edit when launcher becomes visible#729
Merged
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom Mar 11, 2026
Merged
Conversation
When the launcher is shown, the keyboard focus remains on the root InputEventItem instead of the search edit. This causes two issues: 1. The cursor does not appear in the search bar on each open. 2. The IME candidate window is not visible during the preedit phase (e.g. typing pinyin), because InputEventItem is not a text input widget and cannot provide cursor geometry for IME positioning. Fix by calling forceActiveFocus() on the search edit when the launcher becomes visible, for both windowed and fullscreen modes. 修复启动器显示时搜索框未获得焦点的问题。启动器打开时键盘焦点停留在根节点 InputEventItem 上而非搜索框,导致光标不在搜索栏,且中文输入法预编辑阶段 (如拼音输入时)候选框不可见。在启动器可见时对搜索框调用 forceActiveFocus() 以修复此问题,同时修复窗口模式和全屏模式。 PMS: BUG-301743
deepin pr auto review这段代码修改主要涉及 QML 中对启动器(Launcher)显示/隐藏状态变化的处理逻辑。修改的核心目的是在启动器显示时自动聚焦到搜索框,同时保留了隐藏时的清理逻辑。 以下是针对这段 diff 的详细审查意见: 1. 语法逻辑审查结果:通过
2. 代码质量审查结果:良好,有微小的改进空间
3. 代码性能审查结果:通过
4. 代码安全审查结果:通过
总结与建议这段代码修改是安全且合理的,成功实现了启动器显示时自动聚焦搜索框的功能,且没有破坏原有的清理逻辑。 建议:
|
BLumia
approved these changes
Mar 11, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: BLumia, Ivy233 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 |
Contributor
Author
|
/merge |
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.
When the launcher is shown, the keyboard focus remains on the root InputEventItem instead of the search edit. This causes two issues:
Fix by calling forceActiveFocus() on the search edit when the launcher becomes visible, for both windowed and fullscreen modes.
修复启动器显示时搜索框未获得焦点的问题。启动器打开时键盘焦点停留在根节点
InputEventItem 上而非搜索框,导致光标不在搜索栏,且中文输入法预编辑阶段
(如拼音输入时)候选框不可见。在启动器可见时对搜索框调用 forceActiveFocus()
以修复此问题,同时修复窗口模式和全屏模式。
PMS: BUG-301743