@@ -229,10 +229,10 @@ FocusScope {
231 AbstractButton {
231 AbstractButton {
232− enabled: stagesOuterContainer.showProgress == 1
232+ enabled: mainStage.applications.count == 0 && sideStage.shown
233 anchors.fill: parent
233 anchors.fill: parent
234 onClicked: {
234 onClicked: {
235− stages.hide();
235+ sideStage.hide();
@@ -243,7 +243,7 @@ FocusScope {
244 width: parent.width
244 width: parent.width
245 height: parent.height
245 height: parent.height
246− x: launcher.progress
246+ x: mainStage.applications.count > 0 ? launcher.progress : 0
247 Behavior on x {SmoothedAnimation{velocity: 600}}
247 Behavior on x {SmoothedAnimation{velocity: 600}}
249 property real showProgress:
249 property real showProgress:
@@ -255,6 +255,16 @@ FocusScope {
258+ function doLauncherHide() {
259+ if (mainStage.applications.count > 0) {
262+ if (sideStage.shown) {
258 property bool fullyShown: shown && x == 0 && parent.x == 0
268 property bool fullyShown: shown && x == 0 && parent.x == 0
259 property bool fullyHidden: !shown && x == width
269 property bool fullyHidden: !shown && x == width
260 available: !greeter.shown
270 available: !greeter.shown
@@ -339,11 +349,6 @@ FocusScope {
339 rightEdgeDraggingAreaWidth: shell.edgeSize
349 rightEdgeDraggingAreaWidth: shell.edgeSize
340 normalApplicationY: shell.panelHeight
350 normalApplicationY: shell.panelHeight
343− if (!shown && mainStage.applications.count == 0) {
347 // FIXME: when hiding the side stage, refocus the main stage
352 // FIXME: when hiding the side stage, refocus the main stage
348 // application so that it goes in front of the side stage
353 // application so that it goes in front of the side stage
349 // application and hides it
354 // application and hides it
@@ -372,8 +377,16 @@ FocusScope {
372 Connections {
377 Connections {
373 target: sideStage.applications
378 target: sideStage.applications
374 onCountChanged: {
379 onCountChanged: {
380+ if (sideStage.applications.count == 0) {
375− 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
376− 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) {
@@ -588,7 +601,7 @@ FocusScope {
589 InputFilterArea {
602 InputFilterArea {
591− if (applicationManager.sideStageFocusedApplication)
604+ if (applicationManager.sideStageFocusedApplication && sideStage.shown)
592 return parent.width - sideStage.width;
605 return parent.width - sideStage.width;
594 return parent.width;
607 return parent.width;
@@ -728,7 +741,7 @@ FocusScope {
729 onDash: {
742 onDash: {
730 if (stages.shown) {
743 if (stages.shown) {
731− stages.hide();
744+ stages.doLauncherHide();
732 launcher.hide();
745 launcher.hide();