@@ -141,9 +141,15 @@ Item {
141141 id: dropArea
142142 anchors .fill : parent
143143 keys: [" text/x-dde-shell-tray-dnd-surfaceId" ]
144+ property bool isDropped: false
145+ property bool dragExited: false
146+ property string source: " "
147+ property string surfaceId: " "
144148 onEntered : function (dragEvent ) {
145- let surfaceId = dragEvent .getDataAsString (" text/x-dde-shell-tray-dnd-surfaceId" )
146- let source = dragEvent .getDataAsString (" text/x-dde-shell-tray-dnd-source" )
149+ dragExited = false
150+ isDropped = false
151+ surfaceId = dragEvent .getDataAsString (" text/x-dde-shell-tray-dnd-surfaceId" )
152+ source = dragEvent .getDataAsString (" text/x-dde-shell-tray-dnd-source" )
147153 console .log (surfaceId, source)
148154 if (source !== " " && DDT .TraySortOrderModel .isDisplayedSurface (surfaceId)) {
149155 dragEvent .accepted = false
@@ -164,6 +170,7 @@ Item {
164170 if (! isStash) {
165171 if (dropHoverIndex !== 0 ) {
166172 dropTrayTimer .handleDrop = function () {
173+ if (isDropped || dragExited) return
167174 DDT .TraySortOrderModel .dropToDockTray (surfaceId, Math .floor (currentItemIndex), isBefore)
168175 }
169176 dropTrayTimer .start ()
@@ -173,6 +180,7 @@ Item {
173180 }
174181 }
175182 onDropped : function (dropEvent ) {
183+ isDropped = true
176184 let surfaceId = dropEvent .getDataAsString (" text/x-dde-shell-tray-dnd-surfaceId" )
177185 let dropIdx = DDT .TrayItemPositionManager .itemIndexByPoint (Qt .point (drag .x , drag .y ))
178186 let currentItemIndex = dropIdx .index
@@ -182,6 +190,15 @@ Item {
182190 DDT .TraySortOrderModel .actionsAlwaysVisible = false
183191 }
184192
193+ onExited : function () {
194+ dragExited = true
195+ // dragging from quickPanel, entered trayContainer, but not dropped in this area
196+ if (source !== " " && ! isDropped) {
197+ dropTrayTimer .stop ()
198+ DDT .TraySortOrderModel .setSurfaceVisible (surfaceId, false )
199+ }
200+ }
201+
185202 Timer {
186203 id: dropTrayTimer
187204 interval: 50
0 commit comments