lockscreen: Fix potential cause of input unresponsiveness

BUG: 484054
This is a potential fix for the input to stop working. There was unused code for passwordless login that could cause the "waitingForAuth" variable to never be set to false after user input.
This commit is contained in:
Devin Lin 2024-06-23 13:03:12 -04:00
parent e2e6590222
commit e044c84219
2 changed files with 10 additions and 32 deletions

View file

@ -32,7 +32,6 @@ QtObject {
if (root.password !== '') { // prevent typing lock when password is empty if (root.password !== '') { // prevent typing lock when password is empty
waitingForAuth = true; waitingForAuth = true;
} }
connections.hasPrompt = true;
authenticator.startAuthenticating(); authenticator.startAuthenticating();
} }
@ -41,43 +40,22 @@ QtObject {
root.reset(); root.reset();
} }
Component.onCompleted: {
// determine whether we have passwordless login
// if we do, authenticator will emit a success signal, otherwise it will emit failure
// TODO: Disabled for the time being, since it seems to cause an infinite loop
// authenticator.startAuthenticating();
}
property var connections: Connections { property var connections: Connections {
target: authenticator target: authenticator
// false for our test of whether we have passwordless login, otherwise it's true
property bool hasPrompt: false
function onSucceeded() { function onSucceeded() {
if (hasPrompt) {
console.log('login succeeded'); console.log('login succeeded');
root.waitingForAuth = false; root.waitingForAuth = false;
root.unlockSucceeded(); root.unlockSucceeded();
Qt.quit(); Qt.quit();
} }
}
function onFailed(kind) { function onFailed() {
if (kind != 0) { // if this is coming from the noninteractive authenticators
return;
}
// root.passwordless = false;
if (hasPrompt) {
console.log('login failed'); console.log('login failed');
root.waitingForAuth = false; root.waitingForAuth = false;
root.password = ""; root.password = "";
root.unlockFailed(); root.unlockFailed();
} }
}
function onInfoMessageChanged() { function onInfoMessageChanged() {
console.log('info: ' + authenticator.infoMessage); console.log('info: ' + authenticator.infoMessage);

View file

@ -7,7 +7,7 @@ import QtQuick.Controls 2.15
import org.kde.plasma.components 3.0 as PC3 import org.kde.plasma.components 3.0 as PC3
import org.kde.plasma.private.mobileshell as MobileShell import org.kde.plasma.private.mobileshell as MobileShell
import "../lookandfeel/contents/lockscreen" as LockScreen import "../shell/contents/lockscreen" as LockScreen
// This is a test app for the lockscreen, simulating kscreenlocker. // This is a test app for the lockscreen, simulating kscreenlocker.
// //