@@ -130,10 +130,18 @@ FocusScope {
130130 Item {
131131 id: underlay
132132 anchors.fill: parent
133− visible: !(panel.indicators.fullyOpened && shell.width <= panel.indicatorsMenuWidth)
134− && (stages.fullyHidden
135− || (stages.fullyShown && mainStage.usingScreenshots)
136− || !stages.fullyShown && (mainStage.usingScreenshots || (sideStage.shown && sideStage.usingScreenshots)))
133+
134+ // Whether the underlay is fully covered by opaque UI elements.
135+ property bool fullyCovered: panel.indicators.fullyOpened && shell.width <= panel.indicatorsMenuWidth
136+
137+ // Whether the user should see the topmost application surface (if there's one at all).
138+ property bool applicationSurfaceShouldBeSeen:
139+ (mainStage.applications && mainStage.applications.count > 0)
140+ && (!stages.fullyHidden && !mainStage.usingScreenshots)
141+
142+ // NB! Application surfaces are stacked behing the shell one. So they can only be seen by the user
143+ // through the translucent parts of the shell surface.
144+ visible: !fullyCovered && !applicationSurfaceShouldBeSeen
137145
138146 Image {
139147 id: backgroundImage
@@ -178,7 +186,7 @@ FocusScope {
178186 }
179187 }
180188
181− // FIXME: only necessary because stagesRevealer.animatedProgress and
189+ // FIXME: only necessary because stagesOuterContainer.showProgress and
182190 // greeterRevealer.animatedProgress are not animated
183191 Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}
184192 }
@@ -254,6 +262,7 @@ FocusScope {
254262
255263 anchors.fill: parent
256264 fullyShown: stages.fullyShown
265+ fullyHidden: stages.fullyHidden
257266 shouldUseScreenshots: !fullyShown
258267 rightEdgeEnabled: !sideStage.enabled
259268
@@ -338,7 +347,7 @@ FocusScope {
338347 }
339348
340349 DragHandle {
341− id: stagesRevealer
350+ id: stagesDragHandle
342351
343352 anchors.top: parent.top
344353 anchors.bottom: parent.bottom
@@ -346,7 +355,11 @@ FocusScope {
346355
347356 width: shell.edgeSize
348357 direction: Direction.Leftwards
349− enabled: mainStage.applications.count > 0 || sideStage.applications.count > 0
358+ property bool haveApps: mainStage.applications.count > 0 || sideStage.applications.count > 0
359+
360+ maxTotalDragDistance: haveApps ? parent.width : parent.width * 0.7
361+ // Make autocompletion impossible when !haveApps
362+ edgeDragEvaluator.minDragDistance: haveApps ? maxTotalDragDistance * 0.1 : Number.MAX_VALUE
350363 }
351364 }
352365 }