on xenial help sign in
make sure panel buttons are not visible while greeter is shown
commit944fcf18271ccaa03dd196c2e21288358742b8c0 authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 22 Oct 2015, 14:12 (11 years ago) parentd1b0f8c
3 files changed+34−7
qml/Panel/Panel.qml+5−3 qml/Shell.qml+2 tests/qmltests/tst_Shell.qml+27−4
qml/Panel/Panel.qml+5−3
@@ -28,6 +28,7 @@ Item {
2828 property alias callHint: __callHint
2929 property bool fullscreenMode: false
3030 property real indicatorAreaShowProgress: 1.0
31+ property bool locked: false
3132
3233 opacity: fullscreenMode && indicators.fullyClosed ? 0.0 : 1.0
3334
@@ -136,7 +137,7 @@ Item {
136137 }
137138
138139 shown: false
139− width: root.width - (PanelState.buttonsVisible ? windowControlButtons.width : 0)
140+ width: root.width - (windowControlButtons.visible ? windowControlButtons.width : 0)
140141 minimizedPanelHeight: units.gu(3)
141142 expandedPanelHeight: units.gu(7)
142143 openedHeight: root.height - indicatorOrangeLine.height
@@ -164,13 +165,14 @@ Item {
164165
165166 WindowControlButtons {
166167 id: windowControlButtons
168+ objectName: "panelWindowControlButtons"
167169 anchors {
168170 left: parent.left
169171 top: parent.top
170172 margins: units.gu(0.7)
171173 }
172174 height: indicators.minimizedPanelHeight - anchors.margins * 2
173− visible: PanelState.buttonsVisible
175+ visible: PanelState.buttonsVisible && !root.locked
174176 onClose: PanelState.close()
175177 onMinimize: PanelState.minimize()
176178 onMaximize: PanelState.maximize()
@@ -189,7 +191,7 @@ Item {
189191 id: __callHint
190192 anchors {
191193 top: parent.top
192− left: PanelState.buttonsVisible ? windowControlButtons.right : parent.left
194+ left: windowControlButtons.visible ? windowControlButtons.right : parent.left
193195 }
194196 height: indicators.minimizedPanelHeight
195197 visible: active && indicators.state == "initial"
qml/Shell.qml+2
@@ -561,6 +561,8 @@ Item {
561561
562562 fullscreenMode: (topmostApplicationIsFullscreen && !lightDM.greeter.active && launcher.progress == 0)
563563 || greeter.hasLockedApp
564+ locked: greeter && greeter.active
565+ onLockedChanged: print("**********************", greeter.locked, greeter)
564566 }
565567
566568 Launcher {
tests/qmltests/tst_Shell.qml+27−4
@@ -1762,20 +1762,43 @@ Rectangle {
17621762 var appRepeater = findChild(shell, "appRepeater")
17631763 var appId = ApplicationManager.get(0).appId;
17641764 var appDelegate = appRepeater.itemAt(0);
1765+ var panelButtons = findChild(shell, "panelWindowControlButtons")
17651766
17661767 tryCompare(appDelegate, "state", "normal");
1767− tryCompare(PanelState, "buttonsVisible", false);
1768+ tryCompare(panelButtons, "visible", false);
17681769
17691770 appDelegate.maximize(false);
1770− tryCompare(PanelState, "buttonsVisible", true);
1771+ tryCompare(panelButtons, "visible", true);
17711772
17721773 shell.usageScenario = "phone";
17731774 waitForRendering(shell);
1774− tryCompare(PanelState, "buttonsVisible", false);
1775+ tryCompare(panelButtons, "visible", false);
17751776
17761777 shell.usageScenario = "desktop";
17771778 waitForRendering(shell);
1778− tryCompare(PanelState, "buttonsVisible", true);
1779+ tryCompare(panelButtons, "visible", true);
1780+ }
1781+
1782+ function test_lockingGreeterHidesPanelButtons() {
1783+ loadDesktopShellWithApps();
1784+ var appRepeater = findChild(shell, "appRepeater")
1785+ var appId = ApplicationManager.get(0).appId;
1786+ var appDelegate = appRepeater.itemAt(0);
1787+ var panelButtons = findChild(shell, "panelWindowControlButtons")
1788+
1789+ tryCompare(appDelegate, "state", "normal");
1790+ tryCompare(panelButtons, "visible", false);
1791+
1792+ appDelegate.maximize(false);
1793+ tryCompare(panelButtons, "visible", true);
1794+
1795+ LightDM.Greeter.showGreeter();
1796+ waitForRendering(shell);
1797+ tryCompare(panelButtons, "visible", false);
1798+
1799+ LightDM.Greeter.hideGreeter();
1800+ waitForRendering(shell);
1801+ tryCompare(panelButtons, "visible", true);
17791802 }
17801803 }
17811804}