on xenial help sign in
Fix some issues in side stage
9dddd5fDaniel d'Andrada
plugins/WindowManager/TopLevelSurfaceList.cpp+1−1
@@ -23,7 +23,7 @@
23
23
24#include <QMetaObject>
24#include <QMetaObject>
25
25
26−Q_LOGGING_CATEGORY(UNITY_TOPSURFACELIST, "unity.topsurfacelist")
26+Q_LOGGING_CATEGORY(UNITY_TOPSURFACELIST, "unity.topsurfacelist", QtDebugMsg)
27
27
28#define DEBUG_MSG qCDebug(UNITY_TOPSURFACELIST).nospace().noquote() << __func__
28#define DEBUG_MSG qCDebug(UNITY_TOPSURFACELIST).nospace().noquote() << __func__
29
29
qml/Stages/TabletStage.qml+7−10
@@ -180,7 +180,7 @@ AbstractStage {
180
180
181 for (var i = 0; i < spreadRepeater.count && (!choseMainStage || !choseSideStage); ++i) {
181 for (var i = 0; i < spreadRepeater.count && (!choseMainStage || !choseSideStage); ++i) {
182 var spreadDelegate = spreadRepeater.itemAt(i);
182 var spreadDelegate = spreadRepeater.itemAt(i);
183− if (!spreadView.sideStageHidden && spreadDelegate.stage == ApplicationInfoInterface.SideStage
183+ if (sideStage.shown && spreadDelegate.stage == ApplicationInfoInterface.SideStage
184 && !choseSideStage) {
184 && !choseSideStage) {
185 priv.sideStageDelegate = spreadDelegate
185 priv.sideStageDelegate = spreadDelegate
186 priv.sideStageItemId = root.topLevelSurfaceList.idAt(i);
186 priv.sideStageItemId = root.topLevelSurfaceList.idAt(i);
@@ -537,6 +537,7 @@ AbstractStage {
537 if (!app) {
537 if (!app) {
538 return index;
538 return index;
539 }
539 }
540+ var stage = spreadRepeater.itemAt(index) ? spreadRepeater.itemAt(index).stage : app.stage;
540
541
541 // don't shuffle indexes greater than "actives or next"
542 // don't shuffle indexes greater than "actives or next"
542 if (index > 2) return index;
543 if (index > 2) return index;
@@ -549,18 +550,18 @@ AbstractStage {
549 }
550 }
550
551
551 if (spreadView.nextInStack > 0) {
552 if (spreadView.nextInStack > 0) {
552− var nextAppInStack = root.topLevelSurfaceList.applicationAt(spreadView.nextInStack);
553+ var stageOfNextInStack = spreadRepeater.itemAt(spreadView.nextInStack).stage;
553
554
554 if (index === spreadView.nextInStack) {
555 if (index === spreadView.nextInStack) {
555 // this is the next app in stack.
556 // this is the next app in stack.
556
557
557− if (app.stage === ApplicationInfoInterface.SideStage) {
558+ if (stage === ApplicationInfoInterface.SideStage) {
558 // if the next app in stack is a sidestage app, it must order on top of other side stage app
559 // if the next app in stack is a sidestage app, it must order on top of other side stage app
559 return Math.min(2, root.topLevelSurfaceList.count-1);
560 return Math.min(2, root.topLevelSurfaceList.count-1);
560 }
561 }
561 return 1;
562 return 1;
562 }
563 }
563− if (nextAppInStack.stage === ApplicationInfoInterface.SideStage) {
564+ if (stageOfNextInStack === ApplicationInfoInterface.SideStage) {
564 // if the next app in stack is a sidestage app, it must order on top of other side stage app
565 // if the next app in stack is a sidestage app, it must order on top of other side stage app
565 return 1;
566 return 1;
566 }
567 }
@@ -639,9 +640,9 @@ AbstractStage {
639 if (!priv.mainStageItemId) return 0;
640 if (!priv.mainStageItemId) return 0;
640
641
641 if (priv.sideStageItemId && spreadView.nextInStack > 0) {
642 if (priv.sideStageItemId && spreadView.nextInStack > 0) {
642− var nextAppInStack = root.topLevelSurfaceList.applicationAt(spreadView.nextInStack);
643+ var nextDelegateInStack = spreadRepeater.itemAt(spreadView.nextInStack);
643
644
644− if (nextAppInStack.stage === ApplicationInfoInterface.MainStage) {
645+ if (nextDelegateInStack.stage === ApplicationInfoInterface.MainStage) {
645 // if the next app in stack is a main stage app, put the sidestage on top of it.
646 // if the next app in stack is a main stage app, put the sidestage on top of it.
646 return 2;
647 return 2;
647 }
648 }
@@ -944,10 +945,6 @@ AbstractStage {
944 priv.sideStageEnabled && !sideStage.shown) {
945 priv.sideStageEnabled && !sideStage.shown) {
945 // Sidestage was focused, so show the side stage.
946 // Sidestage was focused, so show the side stage.
946 sideStage.show();
947 sideStage.show();
947− // if we've switched to a main app which doesnt support portrait, hide the side stage.
948− } else if (priv.sideStageDelegate === spreadTile &&
949− mainApp && (mainApp.supportedOrientations & (Qt.PortraitOrientation|Qt.InvertedPortraitOrientation)) == 0) {
950− sideStage.hideNow();
951 }
948 }
952 }
949 }
953 }
950 }