[Lock Screen] Do not try to unlock when unvisible

Summary:
In the lock screen, pressing the enter key while the UI is not yet
visible ends up trying to unlock (and would usually fail because the
password field is empty).
Ensure that the UI is visible before unlocking.

BUG: 395671

Test Plan:
Lock the session, press enter. The UI should appear without any
"Unlocking failed" message.

Reviewers: #plasma, #vdg, ngraham, davidedmundson

Reviewed By: #plasma, #vdg, ngraham, davidedmundson

Subscribers: ngraham, davidedmundson, abetts, filipf, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D16219
wilder-5.14
Thomas Surrel 8 years ago
parent c7e9f1242a
commit 754efdedd4
  1. 1
      lookandfeel/contents/lockscreen/LockScreenUi.qml
  2. 7
      lookandfeel/contents/lockscreen/MainBlock.qml

@ -211,6 +211,7 @@ PlasmaCore.ColorScope {
initialItem: MainBlock {
id: mainBlock
lockScreenUiVisible: lockScreenRoot.uiVisible
showUserList: userList.y + mainStack.y > 0

@ -30,6 +30,7 @@ import "../components"
SessionManagementScreen {
property Item mainPasswordBox: passwordBox
property bool lockScreenUiVisible: false
//the y position that should be ensured visible when the on screen keyboard is visible
property int visibleBoundary: mapFromItem(loginButton, 0, 0).y
@ -61,7 +62,11 @@ SessionManagementScreen {
enabled: !authenticator.graceLocked
revealPasswordButtonShown: true
onAccepted: startLogin()
onAccepted: {
if (lockScreenUiVisible) {
startLogin();
}
}
//if empty and left or right is pressed change selection in user switch
//this cannot be in keys.onLeftPressed as then it doesn't reach the password box

Loading…
Cancel
Save