@@ -233,7 +233,7 @@ Item {
233 property int draggedIndex: -1
233 property int draggedIndex: -1
234 property var selectedItem
234 property var selectedItem
235 property bool preDragging: false
235 property bool preDragging: false
236− property bool dragging: selectedItem !== undefined && selectedItem.dragging
236+ property bool dragging: selectedItem !== undefined && selectedItem !== null && selectedItem.dragging
237 property bool postDragging: false
237 property bool postDragging: false
238 property int startX
238 property int startX
239 property int startY
239 property int startY
@@ -241,13 +241,21 @@ Item {
242 onPressed: {
242 onPressed: {
243 selectedItem = launcherListView.itemAt(mouseX, mouseY + launcherListView.realContentY)
243 selectedItem = launcherListView.itemAt(mouseX, mouseY + launcherListView.realContentY)
244+ if (selectedItem !== null) {
244− selectedItem.highlighted = true
245+ selectedItem.highlighted = true
247 onClicked: {
249 onClicked: {
248 var index = Math.floor((mouseY + launcherListView.realContentY) / launcherListView.realItemHeight);
250 var index = Math.floor((mouseY + launcherListView.realContentY) / launcherListView.realItemHeight);
249 var clickedItem = launcherListView.itemAt(mouseX, mouseY + launcherListView.realContentY)
251 var clickedItem = launcherListView.itemAt(mouseX, mouseY + launcherListView.realContentY)
253+ // Check if we actually clicked an item or only at the spacing in between
254+ if (clickedItem === null) {
258+ print("index is", index)
251 // First/last item do the scrolling at more than 12 degrees
259 // First/last item do the scrolling at more than 12 degrees
252 if (index == 0 || index == launcherListView.count - 1) {
260 if (index == 0 || index == launcherListView.count - 1) {
253 if (clickedItem.angle > 12) {
261 if (clickedItem.angle > 12) {
@@ -278,6 +286,10 @@ Item {
280 onReleased: {
288 onReleased: {
289+ if (draggedIndex == -1) {
281 var droppedIndex = draggedIndex;
293 var droppedIndex = draggedIndex;
282 if (dragging) {
294 if (dragging) {
283 postDragging = true;
295 postDragging = true;