From 67288549e65e7a75cd0790c6b5e9a460b8f9a395 Mon Sep 17 00:00:00 2001 From: zhaoyingzhen Date: Mon, 15 Jun 2026 14:12:59 +0800 Subject: [PATCH] fix: prevent app list item overlap after drag on Wayland MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- qml/windowed/AppListView.qml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qml/windowed/AppListView.qml b/qml/windowed/AppListView.qml index 24878853..4896c1b1 100644 --- a/qml/windowed/AppListView.qml +++ b/qml/windowed/AppListView.qml @@ -225,9 +225,12 @@ FocusScope { MouseArea { id: mouseArea anchors.fill: parent + + // Use a dummy Item as drag.target so Wayland dnd doesn't break the original ItemDelegate layout + Item { id: dndTarget } acceptedButtons: Qt.LeftButton | Qt.RightButton - drag.target: itemDelegate + drag.target: dndTarget // 当分类菜单打开时,禁用拖拽功能 enabled: !(ddeCategoryMenu.visible || alphabetCategoryPopup.visible)