@@ -51,6 +51,14 @@ Rectangle {
51 spreadView.contentX = -spreadView.shift;
51 spreadView.contentX = -spreadView.shift;
54+ onSpreadEnabledChanged: {
55+ if (!spreadEnabled) {
56+ // reset. go back to display the focused app
57+ spreadView.selectedIndex = -1;
58+ spreadView.phase = 0;
59+ spreadView.contentX = -spreadView.shift;
54 function updateFocusedAppOrientation() {
62 function updateFocusedAppOrientation() {
55 if (spreadRepeater.count > 0) {
63 if (spreadRepeater.count > 0) {
56 spreadRepeater.itemAt(0).matchShellOrientation();
64 spreadRepeater.itemAt(0).matchShellOrientation();
@@ -281,7 +289,13 @@ Rectangle {
282 switch (phase) {
290 switch (phase) {
292+ // the "spreadEnabled" part is because when code does "phase = 0; contentX = -shift" to
293+ // dismiss the spread because spreadEnabled went to false, for some reason, during tests,
294+ // Flickable might jump in and change contentX value back, causing the code below to do
295+ // "phase = 1" which will make the spread stay.
296+ // It sucks that we have no control whatsoever over whether or when Flickable animates its
284− if (shiftedContentX > width * positionMarker2) {
298+ if (root.spreadEnabled && shiftedContentX > width * positionMarker2) {
285 phase = 1;
299 phase = 1;
@@ -456,6 +470,7 @@ Rectangle {
456 enabled: root.spreadEnabled &&
470 enabled: root.spreadEnabled &&
457 !spreadView.active &&
471 !spreadView.active &&
458 !snapAnimation.running &&
472 !snapAnimation.running &&
473+ !spreadDragArea.pressed &&
459 priv.animateX &&
474 priv.animateX &&
460 !root.beingResized
475 !root.beingResized
461 UbuntuNumberAnimation {
476 UbuntuNumberAnimation {