Skip to content

Instantly share code, notes, and snippets.

@brb
Created June 6, 2014 13:10
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save brb/26ac8fb849ab9ac69d15 to your computer and use it in GitHub Desktop.
a hack to enable paste from clipboard for pinentry (gtk2, based on 0.8.3 vsn). fcks up the security (!)
diff --git a/gtk+-2/pinentry-gtk-2.c b/gtk+-2/pinentry-gtk-2.c
index 421bc02..91a9fbf 100644
--- a/gtk+-2/pinentry-gtk-2.c
+++ b/gtk+-2/pinentry-gtk-2.c
@@ -186,7 +186,7 @@ button_clicked (GtkWidget *widget, gpointer data)
gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (time_out)));
#endif
- s = gtk_secure_entry_get_text (GTK_SECURE_ENTRY (entry));
+ s = gtk_entry_get_text (GTK_ENTRY (entry));
if (!s)
s = "";
passphrase_ok = 1;
@@ -255,7 +255,7 @@ changed_text_handler (GtkWidget *widget)
if (!qualitybar || !pinentry->quality_bar)
return;
- s = gtk_secure_entry_get_text (GTK_SECURE_ENTRY (widget));
+ s = gtk_entry_get_text (GTK_ENTRY (widget));
if (!s)
s = "";
length = strlen (s);
@@ -400,7 +400,9 @@ create_window (int confirm_mode)
GTK_FILL, GTK_FILL, 4, 0);
}
- entry = gtk_secure_entry_new ();
+ entry = gtk_entry_new ();
+ gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);
+
gtk_widget_set_size_request (entry, 200, -1);
g_signal_connect (G_OBJECT (entry), "activate",
G_CALLBACK (enter_callback), entry);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment