@@ -81,6 +81,7 @@ Item {
8181 anchors.left: parent.left
8282 anchors.right: parent.right
8383 height: parent.height - dashItem.height - parent.spacing*2
84+
8485 ListView {
8586 id: launcherListView
8687 objectName: "launcherListView"
@@ -102,6 +103,7 @@ Item {
102103 property int foldingAreaHeight: itemSize * 0.75
103104 property int itemSize: width
104105 property int clickFlickSpeed: units.gu(60)
106+ property int draggedIndex: dndArea.draggedIndex
105107
106108 displaced: Transition {
107109 NumberAnimation { properties: "x,y"; duration: 100 }
@@ -134,7 +136,7 @@ Item {
134136 },
135137 State {
136138 name: "expanded"
137− when: dndArea.draggedIndex >= 0 && !dragging
139+ //when: dndArea.draggedIndex >= 0 && !dragging
138140 PropertyChanges {
139141 target: launcherDelegate
140142 angle: 0
@@ -147,7 +149,7 @@ Item {
147149 Transition {
148150 from: "*"
149151 to: "*"
150− NumberAnimation { properties: "angle,offset"; duration: 200 }
152+// NumberAnimation { properties: "angle,offset"; duration: 200 }
151153 NumberAnimation { properties: "height"; duration: 150 }
152154 }
153155 ]
@@ -222,11 +224,19 @@ Item {
222224 selectedItem.dragging = false;
223225 selectedItem = undefined;
224226
227+ var droppedIndex = draggedIndex;
225228 draggedIndex = -1;
226229 drag.target = undefined
227− launcherListView.interactive = true;
228230
229231 progressiveScrollingTimer.stop();
232+
233+ // FIXME: remove the if condition once the ListView position bug is fixed.
234+ // Right now setting currentIndex to 0 causes more issues than it helps.
235+ if (droppedIndex > 2) {
236+ launcherListView.currentIndex = -1;
237+ launcherListView.currentIndex = droppedIndex;
238+ }
239+ launcherListView.interactive = true;
230240 }
231241
232242 onPressAndHold: {
@@ -279,18 +289,18 @@ Item {
279289 // Move it down by the the missing size to compensate index calculation with only expanded items
280290 itemCenterY += selectedItem.height / 2
281291
282− print("mouseY", mouseY, launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin - realItemSize)
292+// print("mouseY", mouseY, launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin - realItemSize)
283293 if (mouseY > launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin - realItemSize) {
284− print("entered bottom area")
294+// print("entered bottom area")
285295 progressiveScrollingTimer.downwards = false
286296 progressiveScrollingTimer.start()
287297 } else if (mouseY < realItemSize) {
288298 progressiveScrollingTimer.downwards = true
289299 progressiveScrollingTimer.start()
290− print("entered top area")
300+// print("entered top area")
291301 } else {
292302 progressiveScrollingTimer.stop()
293− print("not in any area")
303+// print("not in any area")
294304 }
295305
296306 var newIndex = (itemCenterY + realContentY) / realItemSize