Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public class Greeter.MainWindow : Gtk.ApplicationWindow {
private Greeter.DateTimeWidget datetime_widget;
private unowned LightDM.UserList lightdm_user_list;

private string? saved_credential = null;

private int current_user_card_index = -1;
private unowned Greeter.BaseCard? current_card = null;

Expand Down Expand Up @@ -270,10 +272,10 @@ public class Greeter.MainWindow : Gtk.ApplicationWindow {
case Greeter.FPrintUtils.MessageText.FPRINT_TIMEOUT:
case Greeter.FPrintUtils.MessageText.FPRINT_ERROR:
case Greeter.FPrintUtils.MessageText.OTHER:
current_card.use_fingerprint = false;
break;
default:
current_card.use_fingerprint = true;
saved_credential = null;
break;
}
}
Expand All @@ -286,6 +288,16 @@ public class Greeter.MainWindow : Gtk.ApplicationWindow {
((ManualCard) current_card).wrong_username ();
}
}

if (saved_credential != null) {
try {
lightdm_greeter.respond (saved_credential);
} catch (Error e) {
critical (e.message);
}
} else {
do_connect_username (((UserCard) current_card).lightdm_user.name);
}
}

// Called after the credentials are checked, might be authenticated or not.
Expand Down Expand Up @@ -328,6 +340,8 @@ public class Greeter.MainWindow : Gtk.ApplicationWindow {
}
}

saved_credential = null;

if (user_card != null) {
try {
lightdm_greeter.authenticate (user_card.lightdm_user.name);
Expand Down Expand Up @@ -492,14 +506,7 @@ public class Greeter.MainWindow : Gtk.ApplicationWindow {
}

private void do_connect (string? credential) {
if (credential != null) {
try {
lightdm_greeter.respond (credential);
} catch (Error e) {
critical (e.message);
}
}

saved_credential = credential;
carousel.interactive = false;
carousel.scroll_to (current_card);
}
Expand Down