on xenial help sign in
Disable launcher and panel when locked
a042b06Michael Terry
qml/Shell.qml+5−4
@@ -48,6 +48,7 @@ FocusScope {
48 readonly property real panelHeight: panel.panelHeight
48 readonly property real panelHeight: panel.panelHeight
49
49
50 property bool dashShown: dash.shown
50 property bool dashShown: dash.shown
51+ property bool locked: LightDM.Greeter.active && !LightDM.Greeter.promptless
51
52
52 property bool sideStageEnabled: shell.width >= units.gu(100)
53 property bool sideStageEnabled: shell.width >= units.gu(100)
53 readonly property string focusedApplicationId: ApplicationManager.focusedApplicationId
54 readonly property string focusedApplicationId: ApplicationManager.focusedApplicationId
@@ -628,7 +629,7 @@ FocusScope {
628 LauncherModel.setUser(user);
629 LauncherModel.setUser(user);
629 }
630 }
630
631
631− onTease: launcher.tease()
632+ onTease: if (LightDM.Greeter.promptless) launcher.tease()
632
633
633 Binding {
634 Binding {
634 target: ApplicationManager
635 target: ApplicationManager
@@ -682,7 +683,7 @@ FocusScope {
682 }
683 }
683
684
684 function showDash() {
685 function showDash() {
685− if (LightDM.Greeter.active && !LightDM.Greeter.promptless) {
686+ if (shell.locked) {
686 return;
687 return;
687 }
688 }
688
689
@@ -710,7 +711,7 @@ FocusScope {
710 anchors.fill: parent //because this draws indicator menus
711 anchors.fill: parent //because this draws indicator menus
711 indicators {
712 indicators {
712 hides: [launcher]
713 hides: [launcher]
713− available: edgeDemo.panelEnabled && greeter.fakeActiveForApp === ""
714+ available: edgeDemo.panelEnabled && !shell.locked
714 contentEnabled: edgeDemo.panelContentEnabled
715 contentEnabled: edgeDemo.panelContentEnabled
715 width: parent.width > units.gu(60) ? units.gu(40) : parent.width
716 width: parent.width > units.gu(60) ? units.gu(40) : parent.width
716 panelHeight: units.gu(3)
717 panelHeight: units.gu(3)
@@ -750,7 +751,7 @@ FocusScope {
750 anchors.bottom: parent.bottom
751 anchors.bottom: parent.bottom
751 width: parent.width
752 width: parent.width
752 dragAreaWidth: shell.edgeSize
753 dragAreaWidth: shell.edgeSize
753− available: edgeDemo.launcherEnabled && greeter.fakeActiveForApp === ""
754+ available: edgeDemo.launcherEnabled && !shell.locked
754
755
755 onShowDashHome: showHome()
756 onShowDashHome: showHome()
756 onDash: showDash()
757 onDash: showDash()
tests/qmltests/tst_ShellWithPin.qml+13−4
@@ -149,6 +149,14 @@ Item {
149 tryCompare(sessionSpy, "count", 1)
149 tryCompare(sessionSpy, "count", 1)
150 }
150 }
151
151
152+ function test_disabledEdges() {
153+ var launcher = findChild(shell, "launcher")
154+ tryCompare(launcher, "available", false)
155+
156+ var indicators = findChild(shell, "indicators")
157+ tryCompare(indicators, "available", false)
158+ }
159+
152 function test_emergencyCall() {
160 function test_emergencyCall() {
153 var greeter = findChild(shell, "greeter")
161 var greeter = findChild(shell, "greeter")
154 var lockscreen = findChild(shell, "lockscreen")
162 var lockscreen = findChild(shell, "lockscreen")
@@ -163,10 +171,13 @@ Item {
163 tryCompare(greeter, "fakeActiveForApp", "dialer-app")
171 tryCompare(greeter, "fakeActiveForApp", "dialer-app")
164 tryCompare(lockscreen, "shown", false)
172 tryCompare(lockscreen, "shown", false)
165 tryCompare(panel, "fullscreenMode", true)
173 tryCompare(panel, "fullscreenMode", true)
166− tryCompare(indicators, "available", false)
167− tryCompare(launcher, "available", false)
168 tryCompare(stage, "spreadEnabled", false)
174 tryCompare(stage, "spreadEnabled", false)
169
175
176+ // These are normally false anyway, but confirm they remain so in
177+ // emergency mode.
178+ tryCompare(launcher, "available", false)
179+ tryCompare(indicators, "available", false)
180+
170 // Cancel emergency mode, and go back to normal
181 // Cancel emergency mode, and go back to normal
171 waitForRendering(greeter)
182 waitForRendering(greeter)
172 LightDM.Greeter.showGreeter()
183 LightDM.Greeter.showGreeter()
@@ -175,8 +186,6 @@ Item {
175 tryCompare(greeter, "fakeActiveForApp", "")
186 tryCompare(greeter, "fakeActiveForApp", "")
176 tryCompare(lockscreen, "shown", true)
187 tryCompare(lockscreen, "shown", true)
177 tryCompare(panel, "fullscreenMode", false)
188 tryCompare(panel, "fullscreenMode", false)
178− tryCompare(indicators, "available", true)
179− tryCompare(launcher, "available", true)
180 tryCompare(stage, "spreadEnabled", true)
189 tryCompare(stage, "spreadEnabled", true)
181 }
190 }
182
191