@@ -145,19 +145,23 @@ Rectangle {
145145 // destroyed when dragging them outside the list. This needs to be at least
146146 // itemHeight to prevent folded items from disappearing and DragArea limits
147147 // need to be smaller than this size to avoid breakage.
148− property int extensionSize: 0
149−
150− // Setting extensionSize after the list has been populated because it has
151− // the potential to mess up with the intial positioning in combination
152− // with snapping to the center of the list. This catches all the cases
153− // where the item would be outside the list for more than itemHeight / 2.
154− // For the rest, give it a flick to scroll to the beginning. Note that
155− // the flicking alone isn't enough because in some cases it's not strong
156− // enough to overcome the snapping.
148+ property int extensionSize: itemHeight * 3
149+
150+ // Workaround: The snap settings in the launcher, will always try to
151+ // snap to what we told it to do. However, we want the initial position
152+ // of the launcher to not be centered, but instead start with the topmost
153+ // item unfolded completely. Lets wait for the ListView to settle after
154+ // creation and then reposition it to 0.
157155 // https://bugreports.qt-project.org/browse/QTBUG-32251
158156 Component.onCompleted: {
159− extensionSize = itemHeight * 3
160− flick(0, clickFlickSpeed)
157+ initTimer.start();
158+ }
159+ Timer {
160+ id: initTimer
161+ interval: 1
162+ onTriggered: {
163+ launcherListView.moveToIndex(0)
164+ }
161165 }
162166
163167 // The height of the area where icons start getting folded
@@ -417,7 +421,18 @@ Rectangle {
417421 property int startX
418422 property int startY
419423
424+ // This is a workaround for some issue in the QML ListView:
425+ // When calling moveToItem(0), the listview visually positions itself
426+ // correctly to display the first item expanded. However, some internal
427+ // state seems to not be valid, and the next time the user clicks on it,
428+ // it snaps back to the snap boundries before executing the onClicked handler.
429+ // This can cause the listview getting stuck in a snapped position where you can't
430+ // launch things without first dragging the launcher manually. So lets read the item
431+ // angle before that happens and use that angle instead of the one we get in onClicked.
432+ property real pressedStartAngle: 0
420433 onPressed: {
434+ var clickedItem = launcherListView.itemAt(mouseX, mouseY + launcherListView.realContentY)
435+ pressedStartAngle = clickedItem.angle;
421436 processPress(mouse);
422437 }
423438
@@ -444,9 +459,8 @@ Rectangle {
444459
445460 // First/last item do the scrolling at more than 12 degrees
446461 if (index == 0 || index == launcherListView.count - 1) {
447− if (clickedItem.angle > 12 || clickedItem.angle < -12) {
448− launcherListView.moveToIndex(index);
449− } else {
462+ launcherListView.moveToIndex(index);
463+ if (pressedStartAngle <= 12 && pressedStartAngle >= -12) {
450464 root.applicationSelected(LauncherModel.get(index).appId);
451465 }
452466 return;