on xenial help sign in
some side stage related fixes
commit7b1409aa064ae65f926aae6083e9fbbfb388deb3 authorMichael Zanetti <michael.zanetti@canonical.com> dateWed 28 Sep 2016, 15:03 (10 years ago) parent81c13fa
1 file changed+16−3
qml/Stage/Stage.qml+16−3
qml/Stage/Stage.qml+16−3
@@ -536,7 +536,17 @@ FocusScope {
536536 if (!priv.mainStageItemId) return 0;
537537
538538 if (priv.sideStageItemId && priv.nextInStack > 0) {
539− var nextDelegateInStack = appRepeater.itemAt(priv.nextInStack);
539+
540+ // Due the order in which bindings are evaluated, this might be triggered while shuffling
541+ // the list and index doesn't yet match with itemIndex (even though itemIndex: index)
542+ // Let's walk the list and compare itemIndex to make sure we have the correct one.
543+ var nextDelegateInStack = -1;
544+ for (var i = 0; i < appRepeater.count; i++) {
545+ if (appRepeater.itemAt(i).itemIndex == priv.nextInStack) {
546+ nextDelegateInStack = appRepeater.itemAt(i);
547+ break;
548+ }
549+ }
540550
541551 if (nextDelegateInStack.stage === ApplicationInfoInterface.MainStage) {
542552 // if the next app in stack is a main stage app, put the sidestage on top of it.
@@ -727,8 +737,11 @@ FocusScope {
727737 spreadItem.highlightedIndex = index
728738 priv.goneToSpread = false;
729739 }
730− if (appDelegate.stage == ApplicationInfoInterface.SideStage && !sideStage.shown && root.mode == "stagedWithSideStage") {
731− sideStage.show();
740+ if (root.mode == "stagedWithSideStage") {
741+ if (appDelegate.stage == ApplicationInfoInterface.SideStage && !sideStage.shown) {
742+ sideStage.show();
743+ }
744+ priv.updateMainAndSideStageIndexes();
732745 }
733746
734747 if (root.mode == "windowed") {