on xenial help sign in
some fixes to the app startup phase
commita095a88e442660a1dbbc0e0ff5a286c5cae6a645 authorMichael Zanetti <michael.zanetti@canonical.com> dateMon 10 Feb 2014, 16:47 (13 years ago) parent1f28596
2 files changed+17−5
qml/Shell.qml+1−1 qml/Stages/StageWithSideStage.qml+16−4
qml/Shell.qml+1−1
@@ -236,7 +236,7 @@ FocusScope {
236236
237237 property bool shown: false
238238
239− property real showProgress: MathUtils.clamp(1 - x / shell.width, 0, 1)
239+ property real showProgress: overlayMode ? 0 : MathUtils.clamp(1 - x / shell.width, 0, 1)
240240
241241 property bool fullyShown: x == 0
242242 property bool fullyHidden: x == width
qml/Stages/StageWithSideStage.qml+16−4
@@ -19,6 +19,7 @@ Item {
1919 readonly property bool painting: mainStageImage.visible || sideStageImage.visible || sideStageSnapAnimation.running
2020 property bool fullscreen: priv.focusedApplication ? priv.focusedApplication.fullscreen : false
2121 property bool overlayMode: (sideStageImage.shown && priv.mainStageAppId.length == 0) || priv.overlayOverride
22+ || (priv.mainStageAppId.length == 0 && sideStageSnapAnimation.running)
2223
2324 readonly property int overlayWidth: priv.overlayOverride ? 0 : priv.sideStageWidth
2425
@@ -84,6 +85,7 @@ Item {
8485 property bool waitingForSideScreenshot: false
8586 property bool waitingForScreenshots: waitingForMainScreenshot || waitingForSideScreenshot
8687
88+ property string startingAppId: ""
8789
8890 // Keep overlayMode even if there is no focused app (to allow pulling in the sidestage from the right)
8991 property bool overlayOverride: false
@@ -93,10 +95,19 @@ Item {
9395 if (focusedApplication.stage == ApplicationInfoInterface.MainStage) {
9496 mainStageAppId = focusedApplicationId;
9597 priv.overlayOverride = false;
98+ if (priv.startingAppId == focusedApplicationId && sideStageImage.shown) {
99+ sideStageImage.snapTo(root.width)
100+ priv.startingAppId = "";
101+ }
96102 } else if (focusedApplication.stage == ApplicationInfoInterface.SideStage) {
97103 sideStageAppId = focusedApplicationId;
104+ if (priv.startingAppId == focusedApplicationId && !sideStageImage.shown) {
105+ sideStageImage.snapToApp(focusedApplication);
106+ priv.startingAppId = "";
107+ }
98108 }
99109 }
110+ print("focused app changed", focusedApplicationId, mainStageAppId, sideStageAppId, sideStageImage.shown, priv.startingAppId)
100111 }
101112
102113 onMainStageScreenshotChanged: {
@@ -175,7 +186,8 @@ Item {
175186 Connections {
176187 target: ApplicationManager
177188
178−// onApplicationAdded: {
189+ onApplicationAdded: {
190+ priv.startingAppId = appId;
179191// var application = ApplicationManager.findApplication(appId)
180192// print("Application added:", appId, application.state)
181193// if (application.stage == ApplicationInfoInterface.SideStage) {
@@ -187,7 +199,7 @@ Item {
187199// sideStageImage.switchTo(application)
188200// sideStageImage.visible = true;
189201// }
190−// }
202+ }
191203
192204 onFocusRequested: {
193205 print("focus requested by", appId)
@@ -312,7 +324,7 @@ Item {
312324 x: root.width - width
313325 anchors.bottom: parent.bottom
314326 visible: true
315− property bool shown: false
327+ property bool shown: true
316328
317329// Rectangle { anchors.fill: parent; color: "green"; opacity: 0.5 }
318330
@@ -321,7 +333,7 @@ Item {
321333 }
322334
323335 function snapTo(targetX) {
324− print("snapping to... app:", sideStageImage.application.appId)
336+// print("snapping to... app:", sideStageImage.application.appId)
325337 sideStageSnapAnimation.targetX = targetX
326338 sideStageImage.visible = true;
327339 if (priv.mainStageAppId) {