@@ -34,6 +34,7 @@ Showable {
3434 // 1 when fully shown and 0 when fully hidden
3535 readonly property real showProgress: MathUtils.clamp((width - Math.abs(greeterContentLoader.x)) / width, 0, 1)
3636 readonly property bool fullyShown: showProgress === 1 || lockscreen.shown
37+ readonly property bool semiShown: shown || lockscreen.shown
3738
3839 // True when the greeter is waiting for PAM or other setup process
3940 property bool waiting: true
@@ -52,8 +53,6 @@ Showable {
5253 readonly property bool narrowMode: !multiUser && !tabletMode
5354 readonly property bool multiUser: LightDM.Users.count > 1
5455
55− readonly property int currentIndex: greeterContentLoader.currentIndex
56−
5756 property real dragOffset
5857
5958 // We define a proxy and "is valid" property for launcherOffset because of
@@ -149,7 +148,7 @@ Showable {
149148 waiting = true;
150149
151150 if (narrowMode) {
152− LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
151+ d.selectUser(greeterContentLoader.currentIndex);
153152 } else {
154153 d.reset();
155154 }
@@ -188,6 +187,7 @@ Showable {
188187 var user = LightDM.Users.data(uid, LightDM.UserRoles.NameRole);
189188 AccountsService.user = user;
190189 LauncherModel.setUser(user);
190+ LightDM.Greeter.authenticate(user); // always resets auth state
191191 }
192192
193193 function reset() {
@@ -264,12 +264,6 @@ Showable {
264264 }
265265 }
266266 }
267−
268− Component.onCompleted: {
269− if (greeter.narrowMode) {
270− LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole))
271− }
272− }
273267 }
274268
275269 Rectangle {
@@ -359,28 +353,29 @@ Showable {
359353 d.login();
360354 } else {
361355 AccountsService.failedLogins++
362− if (maxFailedLogins >= 2) { // require at least a warning
363− if (AccountsService.failedLogins === maxFailedLogins - 1) {
364− var title = lockscreen.alphaNumeric ?
365− i18n.tr("Sorry, incorrect passphrase.") :
366− i18n.tr("Sorry, incorrect passcode.")
367− var text = i18n.tr("This will be your last attempt.") + " " +
368− (lockscreen.alphaNumeric ?
369− i18n.tr("If passphrase is entered incorrectly, your phone will conduct a factory reset and all personal data will be deleted.") :
370− i18n.tr("If passcode is entered incorrectly, your phone will conduct a factory reset and all personal data will be deleted."))
371− lockscreen.showInfoPopup(title, text)
372− } else if (AccountsService.failedLogins >= maxFailedLogins) {
373− SystemImage.factoryReset() // Ouch!
374− }
375− }
376− if (failedLoginsDelayAttempts > 0 && AccountsService.failedLogins % failedLoginsDelayAttempts == 0) {
377− lockscreen.delayMinutes = failedLoginsDelayMinutes
378− forcedDelayTimer.start()
379− }
380356
381− lockscreen.clear(true);
382357 if (greeter.narrowMode) {
383− LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole))
358+ if (maxFailedLogins >= 2) { // require at least a warning
359+ if (AccountsService.failedLogins === maxFailedLogins - 1) {
360+ var title = lockscreen.alphaNumeric ?
361+ i18n.tr("Sorry, incorrect passphrase.") :
362+ i18n.tr("Sorry, incorrect passcode.")
363+ var text = i18n.tr("This will be your last attempt.") + " " +
364+ (lockscreen.alphaNumeric ?
365+ i18n.tr("If passphrase is entered incorrectly, your phone will conduct a factory reset and all personal data will be deleted.") :
366+ i18n.tr("If passcode is entered incorrectly, your phone will conduct a factory reset and all personal data will be deleted."))
367+ lockscreen.showInfoPopup(title, text)
368+ } else if (AccountsService.failedLogins >= maxFailedLogins) {
369+ SystemImage.factoryReset() // Ouch!
370+ }
371+ }
372+ if (failedLoginsDelayAttempts > 0 && AccountsService.failedLogins % failedLoginsDelayAttempts == 0) {
373+ lockscreen.delayMinutes = failedLoginsDelayMinutes
374+ forcedDelayTimer.start()
375+ }
376+
377+ lockscreen.clear(true);
378+ d.selectUser(greeterContentLoader.currentIndex);
384379 }
385380 }
386381 }
@@ -389,6 +384,6 @@ Showable {
389384 Binding {
390385 target: LightDM.Greeter
391386 property: "active"
392− value: greeter.fullyShown || greeter.hasLockedApp
387+ value: greeter.semiShown || greeter.hasLockedApp
393388 }
394389}