fix: prevent app list item overlap after drag on Wayland#775
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts the Wayland drag behavior in the windowed app list so that drag operations use an invisible dummy item as the drag target, preserving the layout of the visible ItemDelegate and preventing item overlap after drag. Sequence diagram for Wayland drag using dummy Item targetsequenceDiagram
actor User
participant MouseArea
participant dndTarget
participant ItemDelegate
participant WaylandCompositor
User->>MouseArea: pressAndHold
MouseArea->>MouseArea: startDrag
MouseArea->>dndTarget: set drag.target
MouseArea->>WaylandCompositor: initiateDrag(dndTarget)
Note over ItemDelegate,WaylandCompositor: ItemDelegate remains under ListView layout control
User->>MouseArea: release
WaylandCompositor-->>MouseArea: drop
MouseArea->>ItemDelegate: updateModelOrder
Note over ItemDelegate: No visual overlap after drag on Wayland
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
In category and name sorting modes, the windowed app list should not reorder items when an item is dragged. On Wayland/Treeland, using the visible ItemDelegate itself as the MouseArea drag target can leave the delegate at a dragged offset after release, causing it to overlap with other list items. Use a dummy invisible Item as the drag target in AppListView so the platform drag operation can still start for dock pinning, while the real delegate remains under ListView layout control. 在按分类和按名称排序模式下,窗口模式左侧应用列表不应通过拖拽改变位置。 在 Wayland/Treeland 环境中,如果直接把可见的 ItemDelegate 作为 MouseArea 的拖拽目标,释放后 delegate 可能停留在拖拽偏移位置,导致与其他列表项重叠。 在 AppListView 中改用不可见的 dummy Item 作为拖拽目标,保留拖到 Dock 的 平台拖拽能力,同时让真实 delegate 继续由 ListView 布局管理。 Log: prevent app list item overlap after drag on Wayland Pms: BUG-295171 Change-Id: Ie8df5b75712b552d755a164c59053f518e5a8313
7c33e1b to
6728854
Compare
deepin pr auto review★ 总体评分:100分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 MouseArea {
id: mouseArea
anchors.fill: parent
// 使用虚拟 Item 作为 drag.target,防止 Wayland 拖拽破坏原始 ItemDelegate 布局
Item { id: dndTarget }
acceptedButtons: Qt.LeftButton | Qt.RightButton
drag.target: dndTarget
// 当分类菜单打开时,禁用拖拽功能
enabled: !(ddeCategoryMenu.visible || alphabetCategoryPopup.visible) |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: robertkill, 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 |
Summary
Test plan
cmake --build /tmp/dde-launchpad-build.Pms: BUG-295171
Summary by Sourcery
Bug Fixes: