@@ -25,11 +25,12 @@ FocusScope {
2525 id: root
2626
2727 property bool autohideEnabled: false
28+ property bool lockedVisible: false
2829 property bool available: true // can be used to disable all interactions
2930 property alias inverted: panel.inverted
3031 property bool shadeBackground: true // can be used to disable background shade when launcher is visible
3132
32− property int panelWidth: units.gu(8)
33+ property int panelWidth: units.gu(10)
3334 property int dragAreaWidth: units.gu(1)
3435 property int minimizeDistance: units.gu(26)
3536 property real progress: dragArea.dragging && dragArea.touchX > panelWidth ?
@@ -54,6 +55,7 @@ FocusScope {
5455 signal showDashHome()
5556
5657 onStateChanged: {
58+ print("state changed", state)
5759 if (state == "") {
5860 dismissTimer.stop()
5961 } else {
@@ -92,12 +94,25 @@ FocusScope {
9294 }
9395 }
9496
97+ onLockedVisibleChanged: {
98+ if (lockedVisible && state == "") {
99+ print("have to show")
100+ dismissTimer.stop();
101+ fadeOutAnimation.stop();
102+ switchToNextState("visible")
103+ } else if (!lockedVisible && state == "visible") {
104+ hide();
105+ }
106+ }
107+
95108 function hide() {
96109 switchToNextState("")
97110 }
98111
99112 function fadeOut() {
100− fadeOutAnimation.start();
113+ if (!root.lockedVisible) {
114+ fadeOutAnimation.start();
115+ }
101116 }
102117
103118 function switchToNextState(state) {
@@ -173,7 +188,7 @@ FocusScope {
173188 } else if (panel.highlightIndex >= 0) {
174189 launcherApplicationSelected(LauncherModel.get(panel.highlightIndex).appId);
175190 }
176− root.state = ""
191+ root.hide();
177192 event.accepted = true;
178193 root.focus = false;
179194 }
@@ -207,9 +222,9 @@ FocusScope {
207222 objectName: "dismissTimer"
208223 interval: 500
209224 onTriggered: {
210− if (root.autohideEnabled) {
225+ if (root.autohideEnabled && !root.lockedVisible) {
211226 if (!panel.preventHiding) {
212− root.state = ""
227+ root.hide();
213228 } else {
214229 dismissTimer.restart()
215230 }
@@ -227,6 +242,13 @@ FocusScope {
227242 interval: 1
228243 property string nextState: ""
229244 onTriggered: {
245+ if (root.lockedVisible && nextState == "") {
246+ // Due to binding updates when switching between modes
247+ // it could happen that our request to show will be overwritten
248+ // with a hide request. Rewrite it when we know hiding is not allowed.
249+ nextState = "visible"
250+ }
251+
230252 // switching to an intermediate state here to make sure all the
231253 // values are restored, even if we were already in the target state
232254 root.state = "tmp"
@@ -262,6 +284,7 @@ FocusScope {
262284 script: {
263285 panel.layer.enabled = false
264286 panel.animate = false;
287+ print("setting state to \"\"")
265288 root.state = "";
266289 panel.x = -panel.width
267290 panel.opacity = 1;
@@ -298,10 +321,10 @@ FocusScope {
298321 right: parent.right
299322 bottom: parent.bottom
300323 }
301− enabled: root.shadeBackground && root.state == "visible"
324+ enabled: root.shadeBackground && root.state == "visible" && !root.lockedVisible
302325 visible: enabled // otherwise it will get in the way of cursor selection for some reason
303326 onPressed: {
304− root.state = ""
327+ root.hide();
305328 }
306329 }
307330
@@ -309,7 +332,7 @@ FocusScope {
309332 id: backgroundShade
310333 anchors.fill: parent
311334 color: "black"
312− opacity: root.shadeBackground && root.state == "visible" ? 0.6 : 0
335+ opacity: root.shadeBackground && root.state == "visible" && !root.lockedVisible ? 0.6 : 0
313336
314337 Behavior on opacity { NumberAnimation { duration: UbuntuAnimation.BriskDuration } }
315338 }
@@ -352,11 +375,11 @@ FocusScope {
352375 property bool animate: true
353376
354377 onApplicationSelected: {
355− root.state = ""
378+ root.hide();
356379 launcherApplicationSelected(appId)
357380 }
358381 onShowDashHome: {
359− root.state = ""
382+ root.hide();
360383 root.showDashHome();
361384 }
362385