@@ -114,7 +114,8 @@ Showable {
116 readonly property bool multiUser: LightDMService.users.count > 1
116 readonly property bool multiUser: LightDMService.users.count > 1
117+ readonly property int selectUserIndex: d.getUserIndex(LightDMService.greeter.selectUser)
117− property int currentIndex
118+ property int currentIndex: Math.max(selectUserIndex, 0)
118 property bool waiting
119 property bool waiting
120 // We want 'launcherOffset' to animate down to zero. But not to animate
121 // We want 'launcherOffset' to animate down to zero. But not to animate
@@ -131,7 +132,19 @@ Showable {
131 UbuntuNumberAnimation {}
132 UbuntuNumberAnimation {}
135+ function getUserIndex(username) {
136+ // Find index for requested user, if it exists
137+ for (var i = 0; i < LightDMService.users.count; i++) {
138+ if (username === LightDMService.users.data(i, LightDMService.userRoles.NameRole)) {
134 function selectUser(uid, reset) {
145 function selectUser(uid, reset) {
135 d.waiting = true;
148 d.waiting = true;
136 if (reset) {
149 if (reset) {
137 loader.item.reset();
150 loader.item.reset();
@@ -440,15 +453,7 @@ Showable {
443− onRequestAuthenticationUser: {
456+ onRequestAuthenticationUser: d.selectUser(d.getUserIndex(user), true)
444− // Find index for requested user, if it exists
445− for (var i = 0; i < LightDMService.users.count; i++) {
446− if (user === LightDMService.users.data(i, LightDMService.userRoles.NameRole)) {
447− d.selectUser(i, true);
454 Connections {
459 Connections {