From e044c84219ff849f8727577a9f7bc123dd1db8c3 Mon Sep 17 00:00:00 2001 From: Devin Lin Date: Sun, 23 Jun 2024 13:03:12 -0400 Subject: [PATCH] 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. --- shell/contents/lockscreen/LockScreenState.qml | 40 +++++-------------- tests/LockScreenTest.qml | 2 +- 2 files changed, 10 insertions(+), 32 deletions(-) diff --git a/shell/contents/lockscreen/LockScreenState.qml b/shell/contents/lockscreen/LockScreenState.qml index a08a7908..cec9f317 100644 --- a/shell/contents/lockscreen/LockScreenState.qml +++ b/shell/contents/lockscreen/LockScreenState.qml @@ -32,7 +32,6 @@ QtObject { if (root.password !== '') { // prevent typing lock when password is empty waitingForAuth = true; } - connections.hasPrompt = true; authenticator.startAuthenticating(); } @@ -41,42 +40,21 @@ QtObject { 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 { target: authenticator - // false for our test of whether we have passwordless login, otherwise it's true - property bool hasPrompt: false - function onSucceeded() { - if (hasPrompt) { - console.log('login succeeded'); - root.waitingForAuth = false; - root.unlockSucceeded(); - Qt.quit(); - } + console.log('login succeeded'); + root.waitingForAuth = false; + root.unlockSucceeded(); + Qt.quit(); } - function onFailed(kind) { - if (kind != 0) { // if this is coming from the noninteractive authenticators - return; - } - - // root.passwordless = false; - - if (hasPrompt) { - console.log('login failed'); - root.waitingForAuth = false; - root.password = ""; - root.unlockFailed(); - } + function onFailed() { + console.log('login failed'); + root.waitingForAuth = false; + root.password = ""; + root.unlockFailed(); } function onInfoMessageChanged() { diff --git a/tests/LockScreenTest.qml b/tests/LockScreenTest.qml index d734f96d..031fc8f2 100644 --- a/tests/LockScreenTest.qml +++ b/tests/LockScreenTest.qml @@ -7,7 +7,7 @@ import QtQuick.Controls 2.15 import org.kde.plasma.components 3.0 as PC3 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. //