@@ -829,6 +829,13 @@ FocusScope {
829829 onHeightChanged: appDelegate.updateNormalGeometry();
830830 }
831831
832+ // True when the Stage is focusing this app and playing its own animation.
833+ // Stays true until the app is unfocused.
834+ // If it is, we don't want to play the slide in/out transition from StageMaths.
835+ // Setting it imperatively is not great, but any declarative solution hits
836+ // race conditions, causing two animations to play for one focus event.
837+ property bool inhibitSlideAnimation: false
838+
832839 Binding {
833840 target: appDelegate
834841 property: "y"
@@ -975,6 +982,9 @@ FocusScope {
975982 target: model.window
976983 onFocusedChanged: {
977984 updateQmlFocusFromMirSurfaceFocus();
985+ if (!model.window.focused) {
986+ inhibitSlideAnimation = false;
987+ }
978988 }
979989 onFocusRequested: {
980990 appDelegate.activate();
@@ -1208,6 +1218,9 @@ FocusScope {
12081218 UbuntuNumberAnimation { target: appDelegate; properties: "x"; to: rightEdgeFocusAnimation.targetX; duration: priv.animationDuration }
12091219 UbuntuNumberAnimation { target: decoratedWindow; properties: "angle"; to: 0; duration: priv.animationDuration }
12101220 UbuntuNumberAnimation { target: decoratedWindow; properties: "itemScale"; to: 1; duration: priv.animationDuration }
1221+ onStarted: {
1222+ inhibitSlideAnimation = true;
1223+ }
12111224 onStopped: {
12121225 appDelegate.activate();
12131226 }
@@ -1235,6 +1248,7 @@ FocusScope {
12351248 sideStageX: sideStage.x
12361249 itemIndex: appDelegate.itemIndex
12371250 nextInStack: priv.nextInStack
1251+ animationDuration: priv.animationDuration
12381252 }
12391253
12401254 StagedRightEdgeMaths {
@@ -1387,7 +1401,7 @@ FocusScope {
13871401 }
13881402 PropertyChanges {
13891403 target: stageMaths
1390− animateX: !focusAnimation.running && itemIndex !== spreadItem.highlightedIndex
1404+ animateX: !focusAnimation.running && !rightEdgeFocusAnimation.running && itemIndex !== spreadItem.highlightedIndex && !inhibitSlideAnimation
13911405 }
13921406 PropertyChanges {
13931407 target: appDelegate.window