@@ -83,8 +83,6 @@ FocusScope {
83 applicationManager.setSideStageAppRect(sideStageAppRect);
83 applicationManager.setSideStageAppRect(sideStageAppRect);
86− readonly property bool applicationFocused: !!applicationManager.mainStageFocusedApplication
87− || !!applicationManager.sideStageFocusedApplication
88 // Used for autopilot testing.
86 // Used for autopilot testing.
89 readonly property string currentFocusedAppId: ApplicationManager.focusedApplicationId
87 readonly property string currentFocusedAppId: ApplicationManager.focusedApplicationId
@@ -149,66 +147,94 @@ FocusScope {
149 // Whether the underlay is fully covered by opaque UI elements.
147 // Whether the underlay is fully covered by opaque UI elements.
150 property bool fullyCovered: panel.indicators.fullyOpened && shell.width <= panel.indicatorsMenuWidth
148 property bool fullyCovered: panel.indicators.fullyOpened && shell.width <= panel.indicatorsMenuWidth
152− readonly property bool applicationRunning: ((mainStage.applications && mainStage.applications.count > 0)
150+ readonly property bool mainStageApplicationRunning: mainStage.applications && mainStage.applications.count > 0
153− || (sideStage.applications && sideStage.applications.count > 0))
151+ readonly property bool sideStageApplicationRunning: sideStage.applications && sideStage.applications.count > 0
155 // Whether the user should see the topmost application surface (if there's one at all).
153 // Whether the user should see the topmost application surface (if there's one at all).
156− readonly property bool applicationSurfaceShouldBeSeen: applicationRunning && !stages.fullyHidden
154+ readonly property bool mainStageApplicationShown: mainStageApplicationRunning && !stages.fullyHidden
157 && !mainStage.usingScreenshots // but want sideStage animating over app surface
155 && !mainStage.usingScreenshots // but want sideStage animating over app surface
161 // NB! Application surfaces are stacked behing the shell one. So they can only be seen by the user
159 // NB! Application surfaces are stacked behing the shell one. So they can only be seen by the user
162 // through the translucent parts of the shell surface.
160 // through the translucent parts of the shell surface.
163− visible: !fullyCovered && !applicationSurfaceShouldBeSeen
161+ visible: !fullyCovered && !mainStageApplicationShown
165− Rectangle {
163+ Item {
166− anchors.fill: parent
164+ id: underlayClipper
167− color: "black"
165+ clip: !parent.mainStageApplicationShown && parent.sideStageApplicationRunning && stagesOuterContainer.showProgress > 0
168− opacity: dash.disappearingAnimationProgress
166+ width: {
168+ var w = parent.width - sideStage.width
169+ w += stagesOuterContainer.x + stages.x + (sideStage.x - sideStageRevealer.openedValue)
170+ return Math.min(w, parent.width);
172+ return parent.width;
175+ height: parent.height
172− anchors.fill: dash
178+ anchors.fill: dash
173− source: shell.width > shell.height ? "Dash/graphics/paper_landscape.png" : "Dash/graphics/paper_portrait.png"
179+ source: shell.width > shell.height ? "Dash/graphics/paper_landscape.png" : "Dash/graphics/paper_portrait.png"
174− fillMode: Image.PreserveAspectCrop
180+ fillMode: Image.PreserveAspectCrop
175− horizontalAlignment: Image.AlignRight
181+ horizontalAlignment: Image.AlignRight
176− verticalAlignment: Image.AlignTop
182+ verticalAlignment: Image.AlignTop
189+ available: !greeter.shown && !lockscreen.shown
190+ hides: [stages, launcher, panel.indicators]
191+ shown: disappearingAnimationProgress !== 1.0
192+ enabled: disappearingAnimationProgress === 0.0 && edgeDemo.dashEnabled
193+ // FIXME: unfocus all applications when going back to the dash
196+ shell.applicationManager.unfocusCurrentApplication()
179− Dash {
200+ width: underlay.width
180− id: dash
201+ height: underlay.height - y
181− objectName: "dash"
202+ y: panel.panelHeight
183− available: !greeter.shown && !lockscreen.shown
204+ contentScale: 1.0 - 0.2 * disappearingAnimationProgress
184− hides: [stages, launcher, panel.indicators]
205+ opacity: 1.0 - disappearingAnimationProgress
185− shown: disappearingAnimationProgress !== 1.0
206+ property real disappearingAnimationProgress: {
186− enabled: disappearingAnimationProgress === 0.0 && edgeDemo.dashEnabled
207+ if (greeter.shown) {
187− // FIXME: unfocus all applications when going back to the dash
208+ return greeter.showProgress;
188− onEnabledChanged: {
209+ } else {
189− if (enabled) {
210+ if (underlayClipper.clip)
190− shell.applicationManager.unfocusCurrentApplication()
211+ return 0;
213+ return stagesOuterContainer.showProgress;
217+ // FIXME: only necessary because stagesOuterContainer.showProgress and
218+ // greeterRevealer.animatedProgress are not animated
219+ Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}
194− anchors {
222+ Rectangle {
195− fill: parent
223+ width: underlay.width
196− topMargin: panel.panelHeight
224+ height: underlay.height
226+ opacity: 0.5 * ((sideStage.x - sideStageRevealer.closedValue) / (sideStageRevealer.openedValue - sideStageRevealer.closedValue))
227+ visible: sideStageHideButton.enabled
199− contentScale: 1.0 - 0.2 * disappearingAnimationProgress
230+ AbstractButton {
200− opacity: 1.0 - disappearingAnimationProgress
231+ id: sideStageHideButton
201− property real disappearingAnimationProgress: {
232+ enabled: mainStage.applications.count == 0 && sideStage.shown
202− if (greeter.shown) {
233+ anchors.fill: parent
203− return greeter.showProgress;
234+ onClicked: {
204− } else {
235+ sideStage.hide();
205− return stagesOuterContainer.showProgress;
209− // FIXME: only necessary because stagesOuterContainer.showProgress and
210− // greeterRevealer.animatedProgress are not animated
211− Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}
@@ -217,7 +243,7 @@ FocusScope {
218 width: parent.width
244 width: parent.width
219 height: parent.height
245 height: parent.height
220− x: launcher.progress
246+ x: mainStage.applications.count > 0 ? launcher.progress : 0
221 Behavior on x {SmoothedAnimation{velocity: 600}}
247 Behavior on x {SmoothedAnimation{velocity: 600}}
223 property real showProgress:
249 property real showProgress:
@@ -229,6 +255,16 @@ FocusScope {
258+ function doLauncherHide() {
259+ if (mainStage.applications.count > 0) {
262+ if (sideStage.shown) {
232 property bool fullyShown: shown && x == 0 && parent.x == 0
268 property bool fullyShown: shown && x == 0 && parent.x == 0
233 property bool fullyHidden: !shown && x == width
269 property bool fullyHidden: !shown && x == width
234 available: !greeter.shown
270 available: !greeter.shown
@@ -313,11 +349,6 @@ FocusScope {
313 rightEdgeDraggingAreaWidth: shell.edgeSize
349 rightEdgeDraggingAreaWidth: shell.edgeSize
314 normalApplicationY: shell.panelHeight
350 normalApplicationY: shell.panelHeight
317− if (!shown && mainStage.applications.count == 0) {
321 // FIXME: when hiding the side stage, refocus the main stage
352 // FIXME: when hiding the side stage, refocus the main stage
322 // application so that it goes in front of the side stage
353 // application so that it goes in front of the side stage
323 // application and hides it
354 // application and hides it
@@ -346,8 +377,16 @@ FocusScope {
346 Connections {
377 Connections {
347 target: sideStage.applications
378 target: sideStage.applications
348 onCountChanged: {
379 onCountChanged: {
380+ if (sideStage.applications.count == 0) {
349− if (sideStage.applications.count == 0 && sideStage.shown) { // if all SS app closed, hide side stage
381+ if (sideStage.shown) { // if all SS app closed, hide side stage
350− sideStage.hide();
382+ sideStage.hide();
384+ // Sidestage is hidden and there is no main app, make sure the
385+ // stages is totally hidden too
386+ if (mainStage.applications.count == 0) {
@@ -356,7 +395,7 @@ FocusScope {
356 Revealer {
395 Revealer {
357 id: sideStageRevealer
396 id: sideStageRevealer
359− enabled: mainStage.applications.count > 0 && sideStage.applications.count > 0
398+ enabled: sideStage.applications.count > 0
360 && sideStage.available
399 && sideStage.available
361 direction: Qt.RightToLeft
400 direction: Qt.RightToLeft
362 openedValue: parent.width - sideStage.width
401 openedValue: parent.width - sideStage.width
@@ -437,7 +476,6 @@ FocusScope {
437 Component.onCompleted: {
476 Component.onCompleted: {
438 if (LightDM.Users.count == 1) {
477 if (LightDM.Users.count == 1) {
439 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole))
478 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole))
@@ -478,7 +516,7 @@ FocusScope {
478 hides: [launcher, panel.indicators, hud]
516 hides: [launcher, panel.indicators, hud]
479 shown: true
517 shown: true
481− defaultBackground: shell.background
519+ defaultBackground: shell.defaultBackground
483 y: panel.panelHeight
521 y: panel.panelHeight
484 width: parent.width
522 width: parent.width
@@ -515,7 +553,6 @@ FocusScope {
515 // If there are more users, the Greeter will handle that
553 // If there are more users, the Greeter will handle that
516 if (LightDM.Users.count == 1) {
554 if (LightDM.Users.count == 1) {
517 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
555 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
518− greeter.selected(0);
520 greeter.forceActiveFocus();
557 greeter.forceActiveFocus();
521 removeApplicationFocus();
558 removeApplicationFocus();
@@ -563,8 +600,14 @@ FocusScope {
565 InputFilterArea {
602 InputFilterArea {
566− anchors.fill: parent
603+ width: {
604+ if (applicationManager.sideStageFocusedApplication && sideStage.shown)
605+ return parent.width - sideStage.width;
607+ return parent.width;
609+ height: parent.height
567− blockInput: !applicationFocused || greeter.shown || lockscreen.shown || launcher.shown
610+ blockInput: !applicationManager.mainStageFocusedApplication || greeter.shown || lockscreen.shown || launcher.shown
568 || panel.indicators.shown || hud.shown
611 || panel.indicators.shown || hud.shown
@@ -666,7 +709,7 @@ FocusScope {
666 theHud: hud
709 theHud: hud
667 anchors.fill: parent
710 anchors.fill: parent
668 enabled: hud.available
711 enabled: hud.available
669− applicationIsOnForeground: applicationFocused
712+ applicationIsOnForeground: (stages.shown && mainStage.applications.count > 0) || (stages.shown && sideStage.shown)
672 InputFilterArea {
715 InputFilterArea {
@@ -688,7 +731,7 @@ FocusScope {
688 anchors.bottom: parent.bottom
731 anchors.bottom: parent.bottom
689 width: parent.width
732 width: parent.width
690 dragAreaWidth: shell.edgeSize
733 dragAreaWidth: shell.edgeSize
691− available: (!greeter.shown || greeter.narrowMode) && edgeDemo.launcherEnabled
734+ available: !greeter.locked && edgeDemo.launcherEnabled
693 onShowDashHome: {
736 onShowDashHome: {
694 if (edgeDemo.running)
737 if (edgeDemo.running)
@@ -698,7 +741,7 @@ FocusScope {
699 onDash: {
742 onDash: {
700 if (stages.shown) {
743 if (stages.shown) {
701− stages.hide();
744+ stages.doLauncherHide();
702 launcher.hide();
745 launcher.hide();