on xenial help sign in
make sure panel buttons are not visible while greeter is shown
944fcf1Michael Zanetti
qml/Panel/Panel.qml+5−3
@@ -28,6 +28,7 @@ Item {
28 property alias callHint: __callHint
28 property alias callHint: __callHint
29 property bool fullscreenMode: false
29 property bool fullscreenMode: false
30 property real indicatorAreaShowProgress: 1.0
30 property real indicatorAreaShowProgress: 1.0
31+ property bool locked: false
31
32
32 opacity: fullscreenMode && indicators.fullyClosed ? 0.0 : 1.0
33 opacity: fullscreenMode && indicators.fullyClosed ? 0.0 : 1.0
33
34
@@ -136,7 +137,7 @@ Item {
136 }
137 }
137
138
138 shown: false
139 shown: false
139− width: root.width - (PanelState.buttonsVisible ? windowControlButtons.width : 0)
140+ width: root.width - (windowControlButtons.visible ? windowControlButtons.width : 0)
140 minimizedPanelHeight: units.gu(3)
141 minimizedPanelHeight: units.gu(3)
141 expandedPanelHeight: units.gu(7)
142 expandedPanelHeight: units.gu(7)
142 openedHeight: root.height - indicatorOrangeLine.height
143 openedHeight: root.height - indicatorOrangeLine.height
@@ -164,13 +165,14 @@ Item {
164
165
165 WindowControlButtons {
166 WindowControlButtons {
166 id: windowControlButtons
167 id: windowControlButtons
168+ objectName: "panelWindowControlButtons"
167 anchors {
169 anchors {
168 left: parent.left
170 left: parent.left
169 top: parent.top
171 top: parent.top
170 margins: units.gu(0.7)
172 margins: units.gu(0.7)
171 }
173 }
172 height: indicators.minimizedPanelHeight - anchors.margins * 2
174 height: indicators.minimizedPanelHeight - anchors.margins * 2
173− visible: PanelState.buttonsVisible
175+ visible: PanelState.buttonsVisible && !root.locked
174 onClose: PanelState.close()
176 onClose: PanelState.close()
175 onMinimize: PanelState.minimize()
177 onMinimize: PanelState.minimize()
176 onMaximize: PanelState.maximize()
178 onMaximize: PanelState.maximize()
@@ -189,7 +191,7 @@ Item {
189 id: __callHint
191 id: __callHint
190 anchors {
192 anchors {
191 top: parent.top
193 top: parent.top
192− left: PanelState.buttonsVisible ? windowControlButtons.right : parent.left
194+ left: windowControlButtons.visible ? windowControlButtons.right : parent.left
193 }
195 }
194 height: indicators.minimizedPanelHeight
196 height: indicators.minimizedPanelHeight
195 visible: active && indicators.state == "initial"
197 visible: active && indicators.state == "initial"
qml/Shell.qml+2
@@ -561,6 +561,8 @@ Item {
561
561
562 fullscreenMode: (topmostApplicationIsFullscreen && !lightDM.greeter.active && launcher.progress == 0)
562 fullscreenMode: (topmostApplicationIsFullscreen && !lightDM.greeter.active && launcher.progress == 0)
563 || greeter.hasLockedApp
563 || greeter.hasLockedApp
564+ locked: greeter && greeter.active
565+ onLockedChanged: print("**********************", greeter.locked, greeter)
564 }
566 }
565
567
566 Launcher {
568 Launcher {
tests/qmltests/tst_Shell.qml+27−4
@@ -1762,20 +1762,43 @@ Rectangle {
1762 var appRepeater = findChild(shell, "appRepeater")
1762 var appRepeater = findChild(shell, "appRepeater")
1763 var appId = ApplicationManager.get(0).appId;
1763 var appId = ApplicationManager.get(0).appId;
1764 var appDelegate = appRepeater.itemAt(0);
1764 var appDelegate = appRepeater.itemAt(0);
1765+ var panelButtons = findChild(shell, "panelWindowControlButtons")
1765
1766
1766 tryCompare(appDelegate, "state", "normal");
1767 tryCompare(appDelegate, "state", "normal");
1767− tryCompare(PanelState, "buttonsVisible", false);
1768+ tryCompare(panelButtons, "visible", false);
1768
1769
1769 appDelegate.maximize(false);
1770 appDelegate.maximize(false);
1770− tryCompare(PanelState, "buttonsVisible", true);
1771+ tryCompare(panelButtons, "visible", true);
1771
1772
1772 shell.usageScenario = "phone";
1773 shell.usageScenario = "phone";
1773 waitForRendering(shell);
1774 waitForRendering(shell);
1774− tryCompare(PanelState, "buttonsVisible", false);
1775+ tryCompare(panelButtons, "visible", false);
1775
1776
1776 shell.usageScenario = "desktop";
1777 shell.usageScenario = "desktop";
1777 waitForRendering(shell);
1778 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);
1779 }
1802 }
1780 }
1803 }
1781}
1804}