@@ -245,20 +245,26 @@ Item {
245245 anchors { top: parent.top; right: parent.right; bottom: parent.bottom }
246246 width: root.dragAreaWidth
247247
248+ // Sitting at the right edge of the screen, this EdgeDragArea directly controls the spreadView when
249+ // attachedToView is true. When the finger movement passes positionMarker3 we detach it from the
250+ // spreadView and make the spreadView snap to positionMarker4.
248251 property bool attachedToView: true
249252
250253 property var gesturePoints: new Array()
251254
252255 onTouchXChanged: {
253256 if (!dragging && !priv.waitingForScreenshot) {
257+ // Initial touch. Let's update the screenshot and reset the spreadView to the starting position.
254258 priv.requestNewScreenshot();
255259 spreadView.stage = 0;
256260 spreadView.contentX = -spreadView.shift;
257261 }
258262 if (dragging && attachedToView) {
263+ // Gesture recognized. Let's move the spreadView with the finger
259264 spreadView.contentX = -touchX - spreadView.shift;
260265 }
261266 if (attachedToView && spreadView.shiftedContentX >= spreadView.width * spreadView.positionMarker3) {
267+ // We passed positionMarker3. Detach from spreadView and snap it.
262268 attachedToView = false;
263269 spreadView.snap();
264270 }
@@ -272,6 +278,11 @@ Item {
272278 }
273279
274280 onDraggingChanged: {
281+ if (dragging) {
282+ return;
283+ }
284+
285+ // Ok. The user released. Find out if it was a one-way movement.
275286 var oneWayFlick = true;
276287 var smallestX = spreadDragArea.width;
277288 for (var i = 0; i < gesturePoints.length; i++) {
@@ -283,9 +294,14 @@ Item {
283294 }
284295 gesturePoints = [];
285296
286− if (oneWayFlick && spreadView.shiftedContentX > units.gu(2) && spreadView.shiftedContentX < spreadView.positionMarker1 * spreadView.width) {
297+ if (oneWayFlick && spreadView.shiftedContentX > units.gu(2) &&
298+ spreadView.shiftedContentX < spreadView.positionMarker1 * spreadView.width) {
299+ // If it was a short one-way movement, do the Alt+Tab switch
300+ // no matter if we didn't cross positionMarker1 yet.
287301 spreadView.snapTo(1);
288302 } else if (!dragging && attachedToView) {
303+ // otherwise snap to the closest snap position we can find
304+ // (might be back to start, to app 1 or to spread)
289305 spreadView.snap();
290306 }
291307 }
@@ -321,10 +337,15 @@ Item {
321337
322338 property int tileDistance: width / 4
323339
340+ // Those markers mark the various positions in the spread (ratio to screen width from right to left):
341+ // 0 - 1: following finger, snap back to the beginning on release
324342 property real positionMarker1: 0.3
343+ // 1 - 2: curved snapping movement, snap to app 1 on release
325344 property real positionMarker2: 0.45
345+ // 2 - 3: movement follows finger, snaps back to app 1 on release
326346 property real positionMarker3: 0.6
327− property real positionMarker4: .9
347+ // passing 3, we detach movement from the finger and snap to 4
348+ property real positionMarker4: 0.9
328349
329350 // This is where the first app snaps to when bringing it in from the right edge.
330351 property real snapPosition: 0.75