on xenial help sign in
fix focusing a main stage app if the last opened app was a side stage app
c878ff0Michael Zanetti
qml/Stages/StageWithSideStage.qml+13−3
@@ -26,7 +26,7 @@ Item {
26 onOverlayModeChanged: print(";;;;;;;;;;;;;;;;;;;;;;;;;; overlayModeChanged:", overlayWidth)
26 onOverlayModeChanged: print(";;;;;;;;;;;;;;;;;;;;;;;;;; overlayModeChanged:", overlayWidth)
27
27
28 onShownChanged: {
28 onShownChanged: {
29−// print("shown", shown)
29+ print("___________________________shown", shown)
30 if (!shown) {
30 if (!shown) {
31 priv.mainStageAppId = "";
31 priv.mainStageAppId = "";
32 }
32 }
@@ -58,7 +58,7 @@ Item {
58 }
58 }
59 }
59 }
60
60
61−// Rectangle { anchors.fill: parent; color: "blue"; opacity: 0.5 }
61+ Rectangle { anchors.fill: parent; color: "blue"; opacity: 0.5 }
62
62
63 QtObject {
63 QtObject {
64 id: priv
64 id: priv
@@ -92,6 +92,7 @@ Item {
92 if (focusedApplication) {
92 if (focusedApplication) {
93 if (focusedApplication.stage == ApplicationInfoInterface.MainStage) {
93 if (focusedApplication.stage == ApplicationInfoInterface.MainStage) {
94 mainStageAppId = focusedApplicationId;
94 mainStageAppId = focusedApplicationId;
95+ priv.overlayOverride = false;
95 } else if (focusedApplication.stage == ApplicationInfoInterface.SideStage) {
96 } else if (focusedApplication.stage == ApplicationInfoInterface.SideStage) {
96 sideStageAppId = focusedApplicationId;
97 sideStageAppId = focusedApplicationId;
97 }
98 }
@@ -203,19 +204,28 @@ Item {
203 sideStageImage.snapToApp(application)
204 sideStageImage.snapToApp(application)
204 }
205 }
205 } else if (application.stage == ApplicationInfoInterface.MainStage) {
206 } else if (application.stage == ApplicationInfoInterface.MainStage) {
207+ print("should focus a main stage app")
206 if (root.shown) {
208 if (root.shown) {
209+ print("root is already shown")
207 priv.mainStageAppId = application.appId;
210 priv.mainStageAppId = application.appId;
208 mainStageImage.switchTo(application)
211 mainStageImage.switchTo(application)
209 if (sideStageImage.shown) {
212 if (sideStageImage.shown) {
213+ print("hiding side stage!")
210 sideStageImage.snapTo(root.width)
214 sideStageImage.snapTo(root.width)
211 } else {
215 } else {
216+ print("focusing app", appId)
212 ApplicationManager.focusApplication(appId)
217 ApplicationManager.focusApplication(appId)
213 }
218 }
214 } else {
219 } else {
220+ if (sideStageImage.shown) {
221+ sideStageImage.visible = false;
222+ sideStageImage.x = root.width;
223+ }
224+
215 ApplicationManager.focusApplication(appId)
225 ApplicationManager.focusApplication(appId)
216 }
226 }
217 }
227 }
218− priv.overlayOverride = false;
228+// priv.overlayOverride = false;
219 }
229 }
220
230
221 onApplicationRemoved: {
231 onApplicationRemoved: {