diff options
author | Lionel Le Folgoc <mrpouit@ubuntu.com> | 2012-08-30 19:39:43 +0200 |
---|---|---|
committer | Lionel Le Folgoc <mrpouit@ubuntu.com> | 2012-08-30 19:39:43 +0200 |
commit | a05a8959d288f39ac1d53ffe7a7682794b6a5a28 (patch) | |
tree | a1bd9bbbb4ae062d30fdf7ea52e5ea86472356e9 | |
parent | 98831cde205275997e827e996e41d9692ababb16 (diff) | |
download | lightdm-gtk-greeter-a05a8959d288f39ac1d53ffe7a7682794b6a5a28.tar.gz |
Force refreshing the prompt_box for "Other" after cancel is pressed
(so the ui isn't stuck with a broken password prompt when it should be the
username prompt)
-rw-r--r-- | src/lightdm-gtk-greeter.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/lightdm-gtk-greeter.c b/src/lightdm-gtk-greeter.c index 6430478..f4fee3e 100644 --- a/src/lightdm-gtk-greeter.c +++ b/src/lightdm-gtk-greeter.c @@ -218,6 +218,10 @@ start_authentication (const gchar *username) static void cancel_authentication (void) { + GtkTreeModel *model; + GtkTreeIter iter; + gboolean other = FALSE; + /* If in authentication then stop that first */ cancelling = FALSE; if (lightdm_greeter_get_in_authentication (greeter)) @@ -227,8 +231,20 @@ cancel_authentication (void) set_message_label (""); } + /* Force refreshing the prompt_box for "Other" */ + model = gtk_combo_box_get_model (user_combo); + + if (gtk_combo_box_get_active_iter (user_combo, &iter)) + { + gchar *user; + + gtk_tree_model_get (GTK_TREE_MODEL (model), &iter, 0, &user, -1); + other = (strcmp (user, "*other") == 0); + g_free (user); + } + /* Start a new login or return to the user list */ - if (lightdm_greeter_get_hide_users_hint (greeter)) + if (other || lightdm_greeter_get_hide_users_hint (greeter)) start_authentication ("*other"); else gtk_widget_grab_focus (GTK_WIDGET (user_combo)); |