on xenial help sign in
don't clear lockscreen directly after login, its still visible in the fading animation. Clear it when it is requested to be shown instead
fda2945Michael Zanetti
Greeter/Lockscreen.qml+7−1
@@ -41,7 +41,14 @@ Showable {
41 signal cancel()
41 signal cancel()
42 signal emergencyCall()
42 signal emergencyCall()
43
43
44+ onRequiredChanged: {
45+ if (required && pinPadLoader.item) {
46+ pinPadLoader.item.clear(false);
47+ }
48+ }
49+
44 function reset() {
50 function reset() {
51+ // This causes the loader below to destry and recreate the source
45 pinPadLoader.resetting = true;
52 pinPadLoader.resetting = true;
46 pinPadLoader.resetting = false;
53 pinPadLoader.resetting = false;
47 }
54 }
@@ -140,7 +147,6 @@ Showable {
140 }
147 }
141 if (LightDM.Greeter.authenticated) {
148 if (LightDM.Greeter.authenticated) {
142 root.unlocked();
149 root.unlocked();
143− pinPadLoader.item.clear(false);
144 } else {
150 } else {
145 pinPadLoader.item.clear(true);
151 pinPadLoader.item.clear(true);
146 }
152 }
Shell.qml+1−1
@@ -380,7 +380,7 @@ FocusScope {
380 } else {
380 } else {
381 lockscreen.alphaNumeric = true
381 lockscreen.alphaNumeric = true
382 }
382 }
383− lockscreen.placeholderText = i18n.tr("Please enter %1:").arg(text);
383+ lockscreen.placeholderText = i18n.tr("Please enter %1").arg(text);
384 lockscreen.show();
384 lockscreen.show();
385 }
385 }
386 }
386 }
tests/qmltests/Greeter/tst_Lockscreen.qml+7−1
@@ -187,8 +187,8 @@ Rectangle {
187 unlockedCheckBox.checked = false
187 unlockedCheckBox.checked = false
188 LightDM.Greeter.authenticate(data.username)
188 LightDM.Greeter.authenticate(data.username)
189
189
190+ var inputField = findChild(lockscreen, "pinentryField")
190 if (data.alphanumeric) {
191 if (data.alphanumeric) {
191− var inputField = findChild(lockscreen, "pinentryField")
192 mouseClick(inputField, units.gu(1), units.gu(1))
192 mouseClick(inputField, units.gu(1), units.gu(1))
193 typeString(data.password)
193 typeString(data.password)
194 keyClick(Qt.Key_Enter)
194 keyClick(Qt.Key_Enter)
@@ -200,6 +200,12 @@ Rectangle {
200 }
200 }
201 }
201 }
202 tryCompare(unlockedCheckBox, "checked", data.unlockedSignal)
202 tryCompare(unlockedCheckBox, "checked", data.unlockedSignal)
203+ if (!data.unlockedSignal) {
204+ // make sure the input is cleared on wrong input
205+ tryCompareFunction(function() {return inputField.text.length == 0}, true)
206+ } else {
207+ tryCompareFunction(function() {return inputField.text.length > 0}, true)
208+ }
203 }
209 }
204 }
210 }
205}
211}