diff --git a/qml/windowed/FreeSortListView.qml b/qml/windowed/FreeSortListView.qml index 3bb6a2a4..78e06617 100644 --- a/qml/windowed/FreeSortListView.qml +++ b/qml/windowed/FreeSortListView.qml @@ -315,7 +315,10 @@ Item { Drag.hotSpot.x: width / 3 Drag.hotSpot.y: height / 2 Drag.dragType: Drag.Automatic - Drag.active: mouseArea.drag.active + // Binding Drag.active to mouseArea.drag.active would make Drag.active + // read back the very property it drives (opacity/delayRemove/onActiveChanged), + // causing a QML binding loop. Set it imperatively from the MouseArea instead. + Drag.active: false Drag.mimeData: Helper.generateDragMimeData(model.desktopId) Drag.onActiveChanged: function() { if (!Drag.active) { @@ -341,6 +344,9 @@ Item { acceptedButtons: Qt.LeftButton | Qt.RightButton drag.target: dndTarget + drag.onActiveChanged: function () { + itemDelegate.Drag.active = drag.active + } TapHandler { acceptedDevices: PointerDevice.TouchScreen diff --git a/qml/windowed/IconItemDelegate.qml b/qml/windowed/IconItemDelegate.qml index d5fa0ea7..9a8b403c 100644 --- a/qml/windowed/IconItemDelegate.qml +++ b/qml/windowed/IconItemDelegate.qml @@ -25,7 +25,11 @@ Control { signal menuTriggered() Drag.dragType: Drag.Automatic - Drag.active: mouseArea.drag.active + // Binding Drag.active to mouseArea.drag.active would make Drag.active read + // back the very property it drives (used in opacity/states below), causing a + // QML binding loop. Set it imperatively from the MouseArea's drag handler + // instead. + Drag.active: false states: State { name: "dragged"; @@ -52,6 +56,9 @@ Control { enabled: true acceptedButtons: Qt.LeftButton | Qt.RightButton drag.target: root.dndEnabled ? root : null + drag.onActiveChanged: function () { + root.Drag.active = drag.active + } onPressed: function (mouse) { if (mouse.button === Qt.LeftButton && root.dndEnabled) { appIcon.grabToImage(function(result) {