diff --git a/sddm-theme/Login.qml b/sddm-theme/Login.qml --- a/sddm-theme/Login.qml +++ b/sddm-theme/Login.qml @@ -7,12 +7,13 @@ import org.kde.plasma.components 2.0 as PlasmaComponents SessionManagementScreen { - + id: root property Item mainPasswordBox: passwordBox property bool showUsernamePrompt: !showUserList property string lastUserName + property bool loginScreenUiVisible: false //the y position that should be ensured visible when the on screen keyboard is visible property int visibleBoundary: mapFromItem(loginButton, 0, 0).y @@ -50,7 +51,10 @@ focus: showUsernamePrompt && !lastUserName //if there's a username prompt it gets focus first, otherwise password does placeholderText: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Username") - onAccepted: passwordBox.forceActiveFocus() + onAccepted: + if (root.loginScreenUiVisible) { + passwordBox.forceActiveFocus() + } } PlasmaComponents.TextField { @@ -62,7 +66,11 @@ echoMode: TextInput.Password revealPasswordButtonShown: true - onAccepted: startLogin() + onAccepted: { + if (root.loginScreenUiVisible) { + startLogin(); + } + } Keys.onEscapePressed: { mainStack.currentItem.forceActiveFocus(); diff --git a/sddm-theme/Main.qml b/sddm-theme/Main.qml --- a/sddm-theme/Main.qml +++ b/sddm-theme/Main.qml @@ -147,6 +147,7 @@ initialItem: Login { id: userListComponent userListModel: userModel + loginScreenUiVisible: loginScreenRoot.uiVisible userListCurrentIndex: userModel.lastIndex >= 0 ? userModel.lastIndex : 0 lastUserName: userModel.lastUser showUserList: { @@ -332,6 +333,7 @@ Login { showUsernamePrompt: true notificationMessage: root.notificationMessage + loginScreenUiVisible: loginScreenRoot.uiVisible userListModel: QtObject { property string name: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Log in as a different user")