Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion qml/windowed/FreeSortListView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
Expand Down
9 changes: 8 additions & 1 deletion qml/windowed/IconItemDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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) {
Expand Down
Loading