diff options
| author | Victor Kareh <[email protected]> | 2026-09-01 14:06:25 -0400 |
|---|---|---|
| committer | Luke from DC <[email protected]> | 2026-09-04 05:03:23 +0000 |
| commit | 60b2db361c24e6ff89dfc34a9382280c602f4612 (patch) | |
| tree | 651605b31dbaecf1625dbad210cb61e3f00f1190 /src | |
| parent | 60c1b431040a9fa5ef8c9265359a7a8527260094 (diff) | |
| download | mate-screensaver-master.tar.bz2 mate-screensaver-master.tar.xz | |
This deactivates the password input widget to make sure characters typed
after the user presses Enter are not captured as part of the password.
Fixes #329
Diffstat (limited to 'src')
| -rw-r--r-- | src/gs-lock-plug.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gs-lock-plug.c b/src/gs-lock-plug.c index 597728a..1619f6f 100644 --- a/src/gs-lock-plug.c +++ b/src/gs-lock-plug.c @@ -1874,6 +1874,15 @@ unlock_button_clicked (GtkButton *button, } static void +entry_activate_handler (GtkEntry *entry, + GSLockPlug *plug) +{ + /* Disable input widget to prevent characters typed + * after Enter from being included in the password. */ + gtk_widget_set_sensitive (GTK_WIDGET (entry), FALSE); +} + +static void cancel_button_clicked (GtkButton *button, GSLockPlug *plug) { @@ -2198,6 +2207,9 @@ gs_lock_plug_init (GSLockPlug *plug) /* button press handler used to inhibit popup menu */ g_signal_connect (plug->priv->auth_prompt_entry, "button_press_event", G_CALLBACK (entry_button_press), NULL); + /* capture text on Enter before default button activation */ + g_signal_connect (plug->priv->auth_prompt_entry, "activate", + G_CALLBACK (entry_activate_handler), plug); gtk_entry_set_activates_default (GTK_ENTRY (plug->priv->auth_prompt_entry), TRUE); gtk_entry_set_visibility (GTK_ENTRY (plug->priv->auth_prompt_entry), FALSE); |
