fix(launcher): fix search result items not responding to mouse clicks…#727
fix(launcher): fix search result items not responding to mouse clicks…#727robertkill merged 1 commit intolinuxdeepin:masterfrom
Conversation
… in windowed mode The MouseArea was bound to `enabled: root.dndEnabled`, which defaults to false in SearchResultView delegates. This caused the MouseArea to be completely disabled, preventing onClicked from firing. Meanwhile, the Button consumed mouse events, blocking the outer TapHandler from receiving them — resulting in all three click mechanisms failing. Changed MouseArea to always be enabled and conditionally set drag.target instead, so click handling works regardless of dndEnabled while drag behavior remains controlled. Log: Fix search result items not responding to mouse clicks in windowed mode Influence: 1. Open the launcher in windowed mode 2. Type a keyword in the search box to trigger the search result list 3. Click on an app icon in the search results and verify it launches correctly 4. Right-click on an app icon in the search results and verify the context menu appears 5. Verify click and drag operations still work correctly in the frequently used and recently installed views fix: 修复小窗口模式搜索列表中应用无法鼠标点击的问题 MouseArea 的 enabled 绑定到了 root.dndEnabled,而搜索结果的 delegate 未设置该属性,默认值为 false,导致 MouseArea 被完全禁用,onClicked 无法触发。同时 Button 消费了鼠标事件,阻止了外层 TapHandler 接收 事件,导致三层点击机制全部失效。 将 MouseArea 改为始终启用,仅通过 drag.target 条件控制拖拽行为, 使点击处理不再依赖 dndEnabled 的值。 Log: 修复小窗口模式搜索列表中应用无法鼠标点击的问题 Influence: 1. 打开小窗口模式的启动器 2. 在搜索框中输入关键字,触发搜索结果列表 3. 点击搜索结果中的应用图标,验证应用能正常启动 4. 右键点击搜索结果中的应用图标,验证右键菜单正常弹出 5. 验证常用应用和最近安装区域的点击和拖拽操作仍然正常 PMS: BUG-352527
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts the MouseArea behavior in the windowed launcher icon delegate so that clicks always work while drag behavior is still gated by the drag-and-drop flag, fixing search results not responding to mouse clicks in windowed mode. Sequence diagram for updated click handling in windowed search result itemssequenceDiagram
actor User
participant MouseArea
participant Button
participant TapHandler
participant AppLauncher
rect rgb(230,230,255)
Note over User,AppLauncher: Left-click on search result item (windowed mode)
User->>MouseArea: mousePress(Qt.LeftButton)
alt dndEnabled is true
MouseArea->>MouseArea: drag.target = root
MouseArea-->>User: Begin drag if movement
else dndEnabled is false
MouseArea->>MouseArea: drag.target = null
MouseArea-->>User: Treat as normal click
end
User->>MouseArea: mouseRelease(Qt.LeftButton)
MouseArea->>AppLauncher: onClicked -> launch app
end
rect rgb(230,255,230)
Note over User,AppLauncher: Right-click on search result item
User->>TapHandler: rightClick
TapHandler->>AppLauncher: show context menu
end
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 MouseArea is enabled by default,
enabled: truecan be dropped and you can rely solely on the conditionaldrag.targetbinding to keep the change minimal and consistent with other delegates.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Since MouseArea is enabled by default, `enabled: true` can be dropped and you can rely solely on the conditional `drag.target` binding to keep the change minimal and consistent with other delegates.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
deepin pr auto review这段代码修改了 QML 中的拖拽逻辑,主要涉及 1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
总结与改进建议总体评价: 改进建议:
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, BLumia, robertkill 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 |
… in windowed mode
The MouseArea was bound to
enabled: root.dndEnabled, which defaults to false in SearchResultView delegates. This caused the MouseArea to be completely disabled, preventing onClicked from firing. Meanwhile, the Button consumed mouse events, blocking the outer TapHandler from receiving them — resulting in all three click mechanisms failing.Changed MouseArea to always be enabled and conditionally set drag.target instead, so click handling works regardless of dndEnabled while drag behavior remains controlled.
Log: Fix search result items not responding to mouse clicks in windowed mode
Influence:
fix: 修复小窗口模式搜索列表中应用无法鼠标点击的问题
MouseArea 的 enabled 绑定到了 root.dndEnabled,而搜索结果的 delegate 未设置该属性,默认值为 false,导致 MouseArea 被完全禁用,onClicked
无法触发。同时 Button 消费了鼠标事件,阻止了外层 TapHandler 接收
事件,导致三层点击机制全部失效。
将 MouseArea 改为始终启用,仅通过 drag.target 条件控制拖拽行为,
使点击处理不再依赖 dndEnabled 的值。
Log: 修复小窗口模式搜索列表中应用无法鼠标点击的问题
Influence:
PMS: BUG-352527
Summary by Sourcery
Ensure launcher icon delegates in windowed mode respond correctly to mouse clicks while preserving drag-and-drop behavior.
Bug Fixes:
Enhancements: