@@ -19,6 +19,7 @@ Item {
19 readonly property bool painting: mainStageImage.visible || sideStageImage.visible || sideStageSnapAnimation.running
19 readonly property bool painting: mainStageImage.visible || sideStageImage.visible || sideStageSnapAnimation.running
20 property bool fullscreen: priv.focusedApplication ? priv.focusedApplication.fullscreen : false
20 property bool fullscreen: priv.focusedApplication ? priv.focusedApplication.fullscreen : false
21 property bool overlayMode: (sideStageImage.shown && priv.mainStageAppId.length == 0) || priv.overlayOverride
21 property bool overlayMode: (sideStageImage.shown && priv.mainStageAppId.length == 0) || priv.overlayOverride
22+ || (priv.mainStageAppId.length == 0 && sideStageSnapAnimation.running)
23 readonly property int overlayWidth: priv.overlayOverride ? 0 : priv.sideStageWidth
24 readonly property int overlayWidth: priv.overlayOverride ? 0 : priv.sideStageWidth
@@ -84,6 +85,7 @@ Item {
84 property bool waitingForSideScreenshot: false
85 property bool waitingForSideScreenshot: false
85 property bool waitingForScreenshots: waitingForMainScreenshot || waitingForSideScreenshot
86 property bool waitingForScreenshots: waitingForMainScreenshot || waitingForSideScreenshot
88+ property string startingAppId: ""
88 // Keep overlayMode even if there is no focused app (to allow pulling in the sidestage from the right)
90 // Keep overlayMode even if there is no focused app (to allow pulling in the sidestage from the right)
89 property bool overlayOverride: false
91 property bool overlayOverride: false
@@ -93,10 +95,19 @@ Item {
93 if (focusedApplication.stage == ApplicationInfoInterface.MainStage) {
95 if (focusedApplication.stage == ApplicationInfoInterface.MainStage) {
94 mainStageAppId = focusedApplicationId;
96 mainStageAppId = focusedApplicationId;
95 priv.overlayOverride = false;
97 priv.overlayOverride = false;
98+ if (priv.startingAppId == focusedApplicationId && sideStageImage.shown) {
99+ sideStageImage.snapTo(root.width)
100+ priv.startingAppId = "";
96 } else if (focusedApplication.stage == ApplicationInfoInterface.SideStage) {
102 } else if (focusedApplication.stage == ApplicationInfoInterface.SideStage) {
97 sideStageAppId = focusedApplicationId;
103 sideStageAppId = focusedApplicationId;
104+ if (priv.startingAppId == focusedApplicationId && !sideStageImage.shown) {
105+ sideStageImage.snapToApp(focusedApplication);
106+ priv.startingAppId = "";
110+ print("focused app changed", focusedApplicationId, mainStageAppId, sideStageAppId, sideStageImage.shown, priv.startingAppId)
102 onMainStageScreenshotChanged: {
113 onMainStageScreenshotChanged: {
@@ -175,7 +186,8 @@ Item {
175 Connections {
186 Connections {
176 target: ApplicationManager
187 target: ApplicationManager
178−// onApplicationAdded: {
189+ onApplicationAdded: {
190+ priv.startingAppId = appId;
179// var application = ApplicationManager.findApplication(appId)
191// var application = ApplicationManager.findApplication(appId)
180// print("Application added:", appId, application.state)
192// print("Application added:", appId, application.state)
181// if (application.stage == ApplicationInfoInterface.SideStage) {
193// if (application.stage == ApplicationInfoInterface.SideStage) {
@@ -187,7 +199,7 @@ Item {
187// sideStageImage.switchTo(application)
199// sideStageImage.switchTo(application)
188// sideStageImage.visible = true;
200// sideStageImage.visible = true;
192 onFocusRequested: {
204 onFocusRequested: {
193 print("focus requested by", appId)
205 print("focus requested by", appId)
@@ -312,7 +324,7 @@ Item {
312 x: root.width - width
324 x: root.width - width
313 anchors.bottom: parent.bottom
325 anchors.bottom: parent.bottom
314 visible: true
326 visible: true
315− property bool shown: false
327+ property bool shown: true
317// Rectangle { anchors.fill: parent; color: "green"; opacity: 0.5 }
329// Rectangle { anchors.fill: parent; color: "green"; opacity: 0.5 }
@@ -321,7 +333,7 @@ Item {
323 function snapTo(targetX) {
335 function snapTo(targetX) {
324− print("snapping to... app:", sideStageImage.application.appId)
336+// print("snapping to... app:", sideStageImage.application.appId)
325 sideStageSnapAnimation.targetX = targetX
337 sideStageSnapAnimation.targetX = targetX
326 sideStageImage.visible = true;
338 sideStageImage.visible = true;
327 if (priv.mainStageAppId) {
339 if (priv.mainStageAppId) {