@@ -173,6 +173,16 @@ AbstractStage {
173173
174174 function updateMainAndSideStageIndexes() {
175175// print("updating stage indexes, sideStage shown:", sideStage.shown)
176+ if (root.mode != "stagedWithSideStage") {
177+ priv.sideStageDelegate = null;
178+ priv.sideStageItemId = 0;
179+ priv.sideStageAppId = "";
180+ priv.mainStageDelegate = appRepeater.itemAt(0);
181+ priv.mainStageAppId = topLevelSurfaceList.idAt(0);
182+ priv.mainStageAppId = topLevelSurfaceList.applicationAt(0).appId;
183+ return;
184+ }
185+
176186 var choseMainStage = false;
177187 var choseSideStage = false;
178188
@@ -321,7 +331,7 @@ AbstractStage {
321331 ]
322332 transitions: [
323333 Transition {
324− from: "stagedRightEdge"; to: "spread"
334+ from: "stagedRightEdge,sideStagedRightEdge"; to: "spread"
325335 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
326336 },
327337 Transition {
@@ -806,6 +816,8 @@ AbstractStage {
806816 sideStageDelegate: priv.sideStageDelegate
807817 sideStageWidth: sideStage.panelWidth
808818 sideStageX: sideStage.x
819+ itemIndex: appDelegate.itemIndex
820+ nextInStack: priv.nextInStack
809821 }
810822
811823 StagedRightEdgeMaths {
@@ -824,6 +836,7 @@ AbstractStage {
824836 targetY: spreadMaths.targetY
825837 targetAngle: spreadMaths.targetAngle
826838 targetScale: spreadMaths.targetScale
839+ shuffledZ: stageMaths.itemZ
827840 }
828841
829842 WindowedRightEdgeMaths {
@@ -832,8 +845,6 @@ AbstractStage {
832845 startWidth: appDelegate.requestedWidth
833846 startHeight: appDelegate.requestedHeight
834847 targetHeight: spreadItem.stackHeight
835− startX: appDelegate.windowedX
836− startY: appDelegate.windowedY
837848 targetX: spreadMaths.targetX
838849 targetY: spreadMaths.targetY
839850 normalZ: appDelegate.normalZ
@@ -884,7 +895,7 @@ AbstractStage {
884895 target: appDelegate
885896 x: stagedRightEdgeMaths.animatedX
886897 y: stagedRightEdgeMaths.animatedY
887− z: index +1
898+ z: stagedRightEdgeMaths.animatedZ
888899 height: stagedRightEdgeMaths.animatedHeight
889900 requestedWidth: decoratedWindow.oldRequestedWidth
890901 requestedHeight: decoratedWindow.oldRequestedHeight
@@ -1157,6 +1168,9 @@ AbstractStage {
11571168 to: "windowedRightEdge"
11581169 ScriptAction {
11591170 script: {
1171+ windowedRightEdgeMaths.startX = appDelegate.requestedX
1172+ windowedRightEdgeMaths.startY = appDelegate.requestedY
1173+
11601174 if (index == 1) {
11611175 print("should calculate overlap from", model.application.appId, "with", appRepeater.itemAt(0).application.appId)
11621176 var thisRect = { x: appDelegate.windowedX, y: appDelegate.windowedY, width: appDelegate.requestedWidth, height: appDelegate.requestedHeight }
@@ -1255,7 +1269,6 @@ AbstractStage {
12551269
12561270 property real angle: 0
12571271 property real itemScale: 1
1258− onAngleChanged: print("decoratedWindowd", model.application.appId, "angle", angle)
12591272 transform: [
12601273 Scale {
12611274 origin.x: 0
@@ -1269,6 +1282,15 @@ AbstractStage {
12691282 angle: decoratedWindow.angle
12701283 }
12711284 ]
1285+
1286+ Label {
1287+ anchors.horizontalCenter: parent.horizontalCenter
1288+ anchors.bottom: parent.bottom
1289+ anchors.bottomMargin: units.gu(3)
1290+ color: "red"
1291+ fontSize: "x-large"
1292+ text: appDelegate.z
1293+ }
12721294 }
12731295
12741296 OpacityMask {