summaryrefslogtreecommitdiff
path: root/panels/user-accounts/um-account-dialog.c
diff options
context:
space:
mode:
authorOndrej Holy <oholy@redhat.com>2018-04-11 10:01:20 +0200
committerOndrej Holy <oholy@redhat.com>2018-07-11 10:38:57 +0200
commitd07a67fcb3c6c778d3df621d9643712b89410442 (patch)
treea8fcabef56bd4e6739a87e11285f50364ac3304c /panels/user-accounts/um-account-dialog.c
parentae16a8e7a0ffac76e767fda9c4efa7c10f959440 (diff)
downloadgnome-control-center-d07a67fcb3c6c778d3df621d9643712b89410442.tar.gz
user-accounts: Validate password before moving focus
If <tab> is pressed and password is not yet validated (ie. the verify entry is not sensitive), focus skips the verify entry, even if the password is strong enough. Let's validate the password when <tab> is pressed (ie. before focus change) to prevent this <tab> breakage... https://gitlab.gnome.org/GNOME/gnome-control-center/issues/38
Diffstat (limited to 'panels/user-accounts/um-account-dialog.c')
-rw-r--r--panels/user-accounts/um-account-dialog.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/panels/user-accounts/um-account-dialog.c b/panels/user-accounts/um-account-dialog.c
index bdb950093..34d982664 100644
--- a/panels/user-accounts/um-account-dialog.c
+++ b/panels/user-accounts/um-account-dialog.c
@@ -514,6 +514,20 @@ on_password_focus_out (GtkEntry *entry,
return FALSE;
}
+static gboolean
+on_password_key_press_cb (GtkEntry *entry,
+ GdkEvent *event,
+ gpointer user_data)
+{
+ UmAccountDialog *self = UM_ACCOUNT_DIALOG (user_data);
+ GdkEventKey *key = (GdkEventKey *)event;
+
+ if (key->keyval == GDK_KEY_Tab)
+ local_password_timeout (self);
+
+ return FALSE;
+}
+
static void
on_password_changed (GtkEntry *entry,
GParamSpec *pspec,
@@ -577,6 +591,7 @@ local_init (UmAccountDialog *self)
gtk_widget_set_sensitive (self->local_password, FALSE);
g_signal_connect (self->local_password, "notify::text", G_CALLBACK (on_password_changed), self);
g_signal_connect_after (self->local_password, "focus-out-event", G_CALLBACK (on_password_focus_out), self);
+ g_signal_connect (self->local_password, "key-press-event", G_CALLBACK (on_password_key_press_cb), self);
g_signal_connect_swapped (self->local_password, "activate", G_CALLBACK (dialog_validate), self);
g_signal_connect (self->local_password, "icon-press", G_CALLBACK (on_generate), self);