diff options
author | Matthias Clasen <mclasen@redhat.com> | 2013-08-31 00:14:58 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2013-08-31 00:16:28 -0400 |
commit | 3442933dd7ea6c9f411a021a19202b91cc090610 (patch) | |
tree | 5243877dd7d91b20636ff28b75aff0cd275ac7f1 /gtk/gtkentry.c | |
parent | 350569124d90b84f1531315cff8f4c05dc7d8c03 (diff) | |
download | gtk+-3442933dd7ea6c9f411a021a19202b91cc090610.tar.gz |
Revert "Deprecate and ignore gtk-entry-password-hint-timeout"
This reverts commit 4b5a389e88af7e7a1fa9e33294642dcfbc2832ec.
This change caused considerable concern about accidental
leaking of passwords, see e.g.
https://bugzilla.gnome.org/show_bug.cgi?id=706563
https://bugzilla.gnome.org/show_bug.cgi?id=706873
https://bugzilla.redhat.com/show_bug.cgi?id=994237
We may have to do something else for password entries, such
as the windows-style 'peekabo' icon.
Diffstat (limited to 'gtk/gtkentry.c')
-rw-r--r-- | gtk/gtkentry.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 9ed148c79a..01fa816f55 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -117,7 +117,6 @@ #define MIN_ENTRY_WIDTH 150 #define DRAW_TIMEOUT 20 #define PASSWORD_HINT_MAX 8 -#define PASSWORD_HINT_TIMEOUT 600 #define MAX_ICONS 2 @@ -5177,6 +5176,7 @@ buffer_inserted_text (GtkEntryBuffer *buffer, GtkEntry *entry) { GtkEntryPrivate *priv = entry->priv; + guint password_hint_timeout; guint current_pos; gint selection_bound; @@ -5193,18 +5193,11 @@ buffer_inserted_text (GtkEntryBuffer *buffer, /* Calculate the password hint if it needs to be displayed. */ if (n_chars == 1 && !priv->visible) { - GdkScreen *screen; - gint primary_num; - gint monitor_num; - - screen = gtk_widget_get_screen (GTK_WIDGET (entry)); - primary_num = gdk_screen_get_primary_monitor (screen); - monitor_num = gdk_screen_get_monitor_at_window (screen, priv->text_area); + g_object_get (gtk_widget_get_settings (GTK_WIDGET (entry)), + "gtk-entry-password-hint-timeout", &password_hint_timeout, + NULL); - /* Only show password hint on the primary monitor to help avoid - showing passwords on presentations and the like. Would be - better if we had an explicit presentation mode. */ - if (primary_num == monitor_num) + if (password_hint_timeout > 0) { GtkEntryPasswordHint *password_hint = g_object_get_qdata (G_OBJECT (entry), quark_password_hint); @@ -5218,7 +5211,7 @@ buffer_inserted_text (GtkEntryBuffer *buffer, password_hint->position = position; if (password_hint->source_id) g_source_remove (password_hint->source_id); - password_hint->source_id = gdk_threads_add_timeout (PASSWORD_HINT_TIMEOUT, + password_hint->source_id = gdk_threads_add_timeout (password_hint_timeout, (GSourceFunc)gtk_entry_remove_password_hint, entry); } } |