Lock screen: Avoid wiping password field when getting our first prompt

When the lockscreen is in the screensaver mode we want the keyboard key
pressed to wake the screen to go to the password box textfield. This did
work correctly, but a code path also reset it when we get the first
prompt.

In the (currently hypothetical) case of multiple prompts we would want
to clear anything in the prompt.

This uses the existing boolean flag to handle that appropriately.

BUG: 454108
wilder-5.26
David Edmundson 4 years ago committed by Nate Graham
parent f045cf306c
commit 74a80aaac7
  1. 13
      lookandfeel/contents/lockscreen/LockScreenUi.qml

@ -38,6 +38,7 @@ PlasmaCore.ColorScope {
graceLockTimer.restart();
notificationRemoveTimer.restart();
rejectPasswordAnimation.start();
lockScreenUi.hadPrompt = false;
}
function onSucceeded() {
@ -65,17 +66,21 @@ PlasmaCore.ColorScope {
}
function onPrompt(msg) {
lockScreenUi.hadPrompt = true;
root.notification = msg;
mainBlock.echoMode = TextInput.Normal
mainBlock.mainPasswordBox.text = "";
if (lockScreenUi.hadPrompt) {
mainBlock.mainPasswordBox.text = "";
}
mainBlock.mainPasswordBox.forceActiveFocus();
lockScreenUi.hadPrompt = true;
}
function onPromptForSecret(msg) {
lockScreenUi.hadPrompt = true;
mainBlock.echoMode = TextInput.Password
mainBlock.mainPasswordBox.text = "";
if (lockScreenUi.hadPrompt) {
mainBlock.mainPasswordBox.text = "";
}
mainBlock.mainPasswordBox.forceActiveFocus();
lockScreenUi.hadPrompt = true;
}
}

Loading…
Cancel
Save