@@ -229,10 +229,10 @@ FocusScope {
229229 }
230230
231231 AbstractButton {
232− enabled: stagesOuterContainer.showProgress == 1
232+ enabled: mainStage.applications.count == 0 && sideStage.shown
233233 anchors.fill: parent
234234 onClicked: {
235− stages.hide();
235+ sideStage.hide();
236236 }
237237 }
238238 }
@@ -243,7 +243,7 @@ FocusScope {
243243
244244 width: parent.width
245245 height: parent.height
246− x: launcher.progress
246+ x: mainStage.applications.count > 0 ? launcher.progress : 0
247247 Behavior on x {SmoothedAnimation{velocity: 600}}
248248
249249 property real showProgress:
@@ -255,6 +255,16 @@ FocusScope {
255255
256256 x: width
257257
258+ function doLauncherHide() {
259+ if (mainStage.applications.count > 0) {
260+ hide();
261+ } else {
262+ if (sideStage.shown) {
263+ sideStage.hide();
264+ }
265+ }
266+ }
267+
258268 property bool fullyShown: shown && x == 0 && parent.x == 0
259269 property bool fullyHidden: !shown && x == width
260270 available: !greeter.shown
@@ -339,11 +349,6 @@ FocusScope {
339349 rightEdgeDraggingAreaWidth: shell.edgeSize
340350 normalApplicationY: shell.panelHeight
341351
342− onShownChanged: {
343− if (!shown && mainStage.applications.count == 0) {
344− stages.hide();
345− }
346− }
347352 // FIXME: when hiding the side stage, refocus the main stage
348353 // application so that it goes in front of the side stage
349354 // application and hides it
@@ -372,8 +377,16 @@ FocusScope {
372377 Connections {
373378 target: sideStage.applications
374379 onCountChanged: {
375− if (sideStage.applications.count == 0 && sideStage.shown) { // if all SS app closed, hide side stage
376− sideStage.hide();
380+ if (sideStage.applications.count == 0) {
381+ if (sideStage.shown) { // if all SS app closed, hide side stage
382+ sideStage.hide();
383+ } else {
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) {
387+ stages.hideNow();
388+ }
389+ }
377390 }
378391 }
379392 }
@@ -588,7 +601,7 @@ FocusScope {
588601
589602 InputFilterArea {
590603 width: {
591− if (applicationManager.sideStageFocusedApplication)
604+ if (applicationManager.sideStageFocusedApplication && sideStage.shown)
592605 return parent.width - sideStage.width;
593606 else
594607 return parent.width;
@@ -728,7 +741,7 @@ FocusScope {
728741 }
729742 onDash: {
730743 if (stages.shown) {
731− stages.hide();
744+ stages.doLauncherHide();
732745 launcher.hide();
733746 }
734747 }