on xenial help sign in
Disable launcher and panel when locked
commita042b062db0146d48230541fd6d4c11b5f4069e3 authorMichael Terry <michael.terry@canonical.com> dateMon 28 Jul 2014, 18:23 (12 years ago) parent3955a4b
2 files changed+18−8
qml/Shell.qml+5−4 tests/qmltests/tst_ShellWithPin.qml+13−4
qml/Shell.qml+5−4
@@ -48,6 +48,7 @@ FocusScope {
4848 readonly property real panelHeight: panel.panelHeight
4949
5050 property bool dashShown: dash.shown
51+ property bool locked: LightDM.Greeter.active && !LightDM.Greeter.promptless
5152
5253 property bool sideStageEnabled: shell.width >= units.gu(100)
5354 readonly property string focusedApplicationId: ApplicationManager.focusedApplicationId
@@ -628,7 +629,7 @@ FocusScope {
628629 LauncherModel.setUser(user);
629630 }
630631
631− onTease: launcher.tease()
632+ onTease: if (LightDM.Greeter.promptless) launcher.tease()
632633
633634 Binding {
634635 target: ApplicationManager
@@ -682,7 +683,7 @@ FocusScope {
682683 }
683684
684685 function showDash() {
685− if (LightDM.Greeter.active && !LightDM.Greeter.promptless) {
686+ if (shell.locked) {
686687 return;
687688 }
688689
@@ -710,7 +711,7 @@ FocusScope {
710711 anchors.fill: parent //because this draws indicator menus
711712 indicators {
712713 hides: [launcher]
713− available: edgeDemo.panelEnabled && greeter.fakeActiveForApp === ""
714+ available: edgeDemo.panelEnabled && !shell.locked
714715 contentEnabled: edgeDemo.panelContentEnabled
715716 width: parent.width > units.gu(60) ? units.gu(40) : parent.width
716717 panelHeight: units.gu(3)
@@ -750,7 +751,7 @@ FocusScope {
750751 anchors.bottom: parent.bottom
751752 width: parent.width
752753 dragAreaWidth: shell.edgeSize
753− available: edgeDemo.launcherEnabled && greeter.fakeActiveForApp === ""
754+ available: edgeDemo.launcherEnabled && !shell.locked
754755
755756 onShowDashHome: showHome()
756757 onDash: showDash()
tests/qmltests/tst_ShellWithPin.qml+13−4
@@ -149,6 +149,14 @@ Item {
149149 tryCompare(sessionSpy, "count", 1)
150150 }
151151
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+
152160 function test_emergencyCall() {
153161 var greeter = findChild(shell, "greeter")
154162 var lockscreen = findChild(shell, "lockscreen")
@@ -163,10 +171,13 @@ Item {
163171 tryCompare(greeter, "fakeActiveForApp", "dialer-app")
164172 tryCompare(lockscreen, "shown", false)
165173 tryCompare(panel, "fullscreenMode", true)
166− tryCompare(indicators, "available", false)
167− tryCompare(launcher, "available", false)
168174 tryCompare(stage, "spreadEnabled", false)
169175
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+
170181 // Cancel emergency mode, and go back to normal
171182 waitForRendering(greeter)
172183 LightDM.Greeter.showGreeter()
@@ -175,8 +186,6 @@ Item {
175186 tryCompare(greeter, "fakeActiveForApp", "")
176187 tryCompare(lockscreen, "shown", true)
177188 tryCompare(panel, "fullscreenMode", false)
178− tryCompare(indicators, "available", true)
179− tryCompare(launcher, "available", true)
180189 tryCompare(stage, "spreadEnabled", true)
181190 }
182191