Merge lp:~ennp/lightdm-gtk-greeter/lightdm-gtk-greeter-username-stripping into lp:~lightdm-gtk-greeter-team/lightdm-gtk-greeter/trunk

Proposed by Heinz Deinhart on 2018-01-25
Status: Needs review
Proposed branch: lp:~ennp/lightdm-gtk-greeter/lightdm-gtk-greeter-username-stripping
Merge into: lp:~lightdm-gtk-greeter-team/lightdm-gtk-greeter/trunk
Diff against target: 31 lines (+10/-0)
2 files modified
src/greeterconfiguration.h (+1/-0)
src/lightdm-gtk-greeter.c (+9/-0)
To merge this branch: bzr merge lp:~ennp/lightdm-gtk-greeter/lightdm-gtk-greeter-username-stripping
Reviewer Review Type Date Requested Status
LightDM Gtk+ Greeter Development Team 2018-01-25 Pending
Review via email: mp+336613@code.launchpad.net

Description of the change

Adds boolean config option username-strip-whitespace in greeter section. If set username will be stripped of whitespace.

Main reason: Quite some users tend to click away screensavers with the spacebar and then login fails because they do not notice the space in front of the user name.

To post a comment you must log in.

Unmerged revisions

382. By Heinz Deinhart on 2018-01-25

add configurable whitespace stripping for username field

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/greeterconfiguration.h'
2--- src/greeterconfiguration.h 2015-03-27 05:29:45 +0000
3+++ src/greeterconfiguration.h 2018-01-25 14:47:17 +0000
4@@ -26,6 +26,7 @@
5 #define CONFIG_KEY_PANEL_POSITION "panel-position"
6 #define CONFIG_KEY_KEYBOARD_POSITION "keyboard-position"
7 #define CONFIG_KEY_A11Y_STATES "a11y-states"
8+#define CONFIG_KEY_USERNAME_STRIPPING "username-strip-whitespace"
9
10 #define CONFIG_GROUP_MONITOR "monitor:"
11 #define CONFIG_KEY_BACKGROUND "background"
12
13=== modified file 'src/lightdm-gtk-greeter.c'
14--- src/lightdm-gtk-greeter.c 2017-09-23 01:20:34 +0000
15+++ src/lightdm-gtk-greeter.c 2018-01-25 14:47:17 +0000
16@@ -2179,6 +2179,15 @@
17 gboolean
18 username_focus_out_cb (GtkWidget *widget, GdkEvent *event, gpointer user_data)
19 {
20+ if (config_get_bool (NULL, CONFIG_KEY_USERNAME_STRIPPING, FALSE)) {
21+ gchar *tmpstr = g_strdup( gtk_entry_get_text(username_entry));
22+
23+ g_strstrip(tmpstr);
24+ gtk_entry_set_text(username_entry, tmpstr);
25+ g_free(tmpstr);
26+ }
27+
28+
29 if (!g_strcmp0(gtk_entry_get_text (username_entry), "") == 0)
30 start_authentication (gtk_entry_get_text (username_entry));
31 return FALSE;

Subscribers

People subscribed via source and target branches