Conversation
1. Root cause: IconItemDelegate.qml MouseArea.onPressed lacks mouse.source check, touch-synthesized events consumed by drag mechanism, blocking parent Flickable scrolling 2. Fix: add mouse.source guard to reject synthesized events, add TapHandler for touch tap and long-press menu support 3. Impact: only IconItemDelegate.qml changed, real mouse interaction unaffected, follows same pattern as AppListView (f86bd7a) Log: fix touch scroll triggering app drag in windowed launcher Influence: 1. Test touchscreen single-finger scroll in app grid area 2. Test touchscreen tap to open app and long-press for context menu 3. Test mouse left-click, right-click, and drag remain functional fix: 过滤窗口模式图标代理的触摸事件 1. 根因:IconItemDelegate.qml 的 MouseArea.onPressed 缺少 mouse.source 检查,触摸合成事件被 drag 机制消费,阻止父级 Flickable 滚动 2. 方案:添加 mouse.source 守卫拒绝合成事件,添加 TapHandler 支持触摸点击和长按菜单 3. 影响:仅修改 IconItemDelegate.qml,真实鼠标交互不受影响, 与 AppListView(f86bd7a)修复模式一致 Log: 修复窗口模式启动器触摸滑动触发应用拖拽的问题 Influence: 1. 测试触控屏单指在应用网格区域滑动滚动 2. 测试触控屏点击打开应用和长按弹出右键菜单 3. 测试鼠标左键点击、右键菜单、拖拽功能正常 PMS: BUG-309193
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mhduiy 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 |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates the windowed icon delegate to prevent synthesized touchscreen presses from starting app drags, allowing the parent grid to scroll, while adding TouchScreen-specific tap and long-press handling so touch activation and context menus remain functional without changing mouse interactions. Sequence diagram for touch input in the windowed icon delegatesequenceDiagram
actor User
participant Touchscreen
participant IconItemDelegate
participant GridView
participant App
participant ContextMenu
User->>Touchscreen: Touch and drag
Touchscreen->>IconItemDelegate: onPressed(mouse)
alt synthesized mouse event
IconItemDelegate-->>GridView: mouse.accepted = false
GridView->>GridView: Scroll content
else touch tap
Touchscreen->>IconItemDelegate: TapHandler.onTapped()
IconItemDelegate->>App: itemClicked()
else touch long press
Touchscreen->>IconItemDelegate: TapHandler.onLongPressed()
IconItemDelegate->>ContextMenu: menuTriggered()
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
📋 提交信息
🔍 详细分析1. 语法逻辑 ✓ (25/25分)评价词: 语法正确,逻辑清晰 分析:
潜在问题: 2. 代码质量 ✓ (25/25分)评价词: 代码结构清晰,注释完整 分析:
潜在问题: 3. 代码性能 ✓ (20/20分)评价词: 性能良好,资源使用合理 分析:
潜在问题: 4. 代码安全 ✓ (30/30分)评价词: 存在0个安全漏洞 分析:
漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个 安全漏洞详情: 📝 审查总结本次 PR 修复了 修复方案正确且一致:
代码变更风险评估为低风险,不影响现有鼠标交互功能。 本报告由 AI 代码审查工具自动生成 |
Root Cause Analysis
IconItemDelegate.qmlMouseArea.onPressed lacksmouse.sourcetouch-synthesized event filtering. When a touchscreen finger press is synthesized as a mouse event, the MouseArea'sdrag.targetconsumes it, triggering app drag instead of letting the parent GridView/Flickable scroll. This is the same defect class as BUG-362161 (commit f86bd7a), which fixedAppListView.qmlandFreeSortListView.qmlbut missedIconItemDelegate.qml.Key evidence:
qml/windowed/IconItemDelegate.qml:58—drag.target: root.dndEnabled ? root : nullenables dragqml/windowed/IconItemDelegate.qml:62-68— onPressed has nomouse.sourcecheckqml/windowed/AppListView.qml:253-258— already fixed with source check guard (f86bd7a)Fix
Add
mouse.sourcecheck inonPressedto reject touch-synthesized events (same pattern as f86bd7a), and addTapHandler { acceptedDevices: PointerDevice.TouchScreen }for touch tap activation and long-press context menu support.Change Safety Assessment
Code Safety
Risk: Low. The
mouse.sourceguard only rejects synthesized events (source !=Qt.MouseEventNotSynthesized); real mouse events pass through unaffected. The TapHandler is restricted toPointerDevice.TouchScreenand does not interfere with mouse event delivery. The same pattern is validated inAppListView.qml.Historical note: commit 2c2921f (BUG-358827) removed a previous TapHandler due to event conflicts with MouseArea. However, that conflict involved TapHandlers accepting mouse buttons — this fix's TapHandler only accepts touch screen devices, and the current code already handles right-click via
onClicked.AppListViewuses the identical pattern successfully.Business Impact
Verification Suggestions
根因分析
IconItemDelegate.qml的 MouseArea.onPressed 缺少mouse.source触摸合成事件过滤。触摸屏单指按下被 Qt 合成为鼠标事件后,MouseArea 的drag.target消费该事件触发应用拖拽,阻止父级 GridView/Flickable 滚动。与 BUG-362161(commit f86bd7a)同一类缺陷,上次修复覆盖了AppListView.qml和FreeSortListView.qml,遗漏了IconItemDelegate.qml。修复方案
在
onPressed中添加mouse.source检查守卫拒绝触摸合成事件(与 f86bd7a 模式一致),添加TapHandler { acceptedDevices: PointerDevice.TouchScreen }支持触摸点击激活和长按右键菜单。改动安全评估
代码安全
风险:低。
mouse.source守卫仅拒绝合成事件,真实鼠标事件不受影响。TapHandler 限定PointerDevice.TouchScreen,不干扰鼠标事件分发。AppListView.qml已验证相同模式可行。业务影响
验证建议
Summary by Sourcery
Fix touchscreen interaction handling in the windowed icon delegate so scrolling, activation, and context menus work correctly without affecting mouse controls.
New Features:
Bug Fixes: