From afdbf2cfd10534260e4a3d427e0aed8410c77a1f Mon Sep 17 00:00:00 2001 From: zhangkun2 Date: Mon, 30 Nov 2026 13:51:33 +0800 Subject: [PATCH] fix: show forbidden cursor when dragging in overflow popup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Root cause: the overflow popup DropArea in TaskOverflowButton.qml onEntered handler called drag.accept(Qt.MoveAction), which shows a move cursor. The expected behavior is a forbidden (no-drop) cursor when dragging overflow-popup items over the overflow area 2. Fix: change drag.accept(Qt.MoveAction) to drag.accept(Qt.IgnoreAction) in onEntered so the cursor shows a forbidden icon. onDropped for overflow-popup source is retained but won't fire since the drag is rejected at enter time — this is the intended behavior 3. Impact: only affects cursor display during drag-enter into the overflow popup for overflow-popup drag source; other drag sources and drop behaviors are unchanged Log: overflow popup now shows forbidden cursor instead of move cursor when dragging items inside it Influence: 1. Drag an app icon inside the overflow popup and verify the cursor shows a forbidden (no-drop) icon instead of a move cursor 2. Drag an app icon from the taskbar into the overflow popup and verify the cursor and drop behavior are unchanged 3. Drag an app icon out of the overflow popup and verify residence is preserved fix: 修复溢出区域拖拽时光标应显示为禁止状态 1. 根因:溢出弹窗 DropArea 的 onEntered 调用 drag.accept(Qt.MoveAction), 光标显示为移动光标,但预期行为为禁止光标(不允许放置) 2. 方案:将 onEntered 中的 drag.accept(Qt.MoveAction) 改为 drag.accept(Qt.IgnoreAction),使光标显示禁止图标。onDropped 中 overflow-popup 源的处理保留但因拖拽在进入时被拒绝而不再触发, 符合预期行为 3. 影响:仅影响溢出弹窗内 overflow-popup 拖拽源进入时的光标显示, 其他拖拽源和拖放行为不变 Log: 溢出区域内拖拽图标时光标从移动状态改为禁止状态 Influence: 1. 在溢出弹窗内拖拽应用图标,确认光标显示为禁止图标而非移动光标 2. 从任务栏拖拽应用图标到溢出弹窗,确认光标和拖放行为无变化 3. 从溢出弹窗拖出应用图标,确认驻留属性保持不变 PMS: BUG-384773 --- panels/dock/taskmanager/package/TaskOverflowButton.qml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/panels/dock/taskmanager/package/TaskOverflowButton.qml b/panels/dock/taskmanager/package/TaskOverflowButton.qml index b0f2e79a1..10c15fab5 100644 --- a/panels/dock/taskmanager/package/TaskOverflowButton.qml +++ b/panels/dock/taskmanager/package/TaskOverflowButton.qml @@ -260,6 +260,10 @@ Item { DropArea { anchors.fill: parent keys: ["text/x-dde-dock-dnd-appid", "text/x-dde-dock-dnd-folder"] + onEntered: function(drag) { + if (drag.getDataAsString("text/x-dde-dock-dnd-source") === "overflow-popup") + drag.accept(Qt.IgnoreAction) + } onDropped: function(drop) { if (drop.getDataAsString("text/x-dde-dock-dnd-source") === "overflow-popup") drop.accept(Qt.MoveAction)