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
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 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

add configurable whitespace stripping for username field

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/greeterconfiguration.h'
--- src/greeterconfiguration.h 2015-03-27 05:29:45 +0000
+++ src/greeterconfiguration.h 2018-01-25 14:47:17 +0000
@@ -26,6 +26,7 @@
26#define CONFIG_KEY_PANEL_POSITION "panel-position"26#define CONFIG_KEY_PANEL_POSITION "panel-position"
27#define CONFIG_KEY_KEYBOARD_POSITION "keyboard-position"27#define CONFIG_KEY_KEYBOARD_POSITION "keyboard-position"
28#define CONFIG_KEY_A11Y_STATES "a11y-states"28#define CONFIG_KEY_A11Y_STATES "a11y-states"
29#define CONFIG_KEY_USERNAME_STRIPPING "username-strip-whitespace"
2930
30#define CONFIG_GROUP_MONITOR "monitor:"31#define CONFIG_GROUP_MONITOR "monitor:"
31#define CONFIG_KEY_BACKGROUND "background"32#define CONFIG_KEY_BACKGROUND "background"
3233
=== modified file 'src/lightdm-gtk-greeter.c'
--- src/lightdm-gtk-greeter.c 2017-09-23 01:20:34 +0000
+++ src/lightdm-gtk-greeter.c 2018-01-25 14:47:17 +0000
@@ -2179,6 +2179,15 @@
2179gboolean2179gboolean
2180username_focus_out_cb (GtkWidget *widget, GdkEvent *event, gpointer user_data)2180username_focus_out_cb (GtkWidget *widget, GdkEvent *event, gpointer user_data)
2181{2181{
2182 if (config_get_bool (NULL, CONFIG_KEY_USERNAME_STRIPPING, FALSE)) {
2183 gchar *tmpstr = g_strdup( gtk_entry_get_text(username_entry));
2184
2185 g_strstrip(tmpstr);
2186 gtk_entry_set_text(username_entry, tmpstr);
2187 g_free(tmpstr);
2188 }
2189
2190
2182 if (!g_strcmp0(gtk_entry_get_text (username_entry), "") == 0)2191 if (!g_strcmp0(gtk_entry_get_text (username_entry), "") == 0)
2183 start_authentication (gtk_entry_get_text (username_entry));2192 start_authentication (gtk_entry_get_text (username_entry));
2184 return FALSE;2193 return FALSE;

Subscribers

People subscribed via source and target branches