diff options
author | Robert Ancell <robert.ancell@canonical.com> | 2016-09-15 09:11:49 +0000 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-09-15 09:12:18 +0000 |
commit | 440a813afff0260ed0030c9debf1c15a60121a7f (patch) | |
tree | 3e3b27618139384677ab2cf02cbb451c6e8fe75a | |
parent | df985b3fea30d85e86c7e123d7fb3fd65a09703c (diff) | |
download | arctica-greeter-440a813afff0260ed0030c9debf1c15a60121a7f.tar.gz arctica-greeter-440a813afff0260ed0030c9debf1c15a60121a7f.tar.bz2 arctica-greeter-440a813afff0260ed0030c9debf1c15a60121a7f.zip |
Limit prompt fields to 200 characters in case a key is being held down (e.g. by a cat).
-rw-r--r-- | src/greeter-list.vala | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/greeter-list.vala b/src/greeter-list.vala index 7fafdcb..5f830da 100644 --- a/src/greeter-list.vala +++ b/src/greeter-list.vala @@ -19,6 +19,8 @@ * Scott Sweeny <scott.sweeny@canonical.com> */ +private const int MAX_FIELD_SIZE = 200; + private int get_grid_offset (int size) { return (int) (size % grid_size) / 2; @@ -808,7 +810,10 @@ public abstract class GreeterList : FadableBox text = _("Password:"); if (text == "login:") text = _("Username:"); - add_prompt (text, type == LightDM.PromptType.SECRET); + var entry = add_prompt (text, type == LightDM.PromptType.SECRET); + + /* Limit the number of characters in case a cat is sitting on the keyboard... */ + entry.max_length = MAX_FIELD_SIZE; } protected virtual void authentication_complete_cb () |