From 454fe4fdf730f0dc45b5005d108ec2e1d4a523ed Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 17 May 2015 16:40:36 +0100 Subject: [PATCH] askpass: don't treat releases of Ret or Esc as presses. Caused an embarrassing failure just now trying to run the test program from a command prompt - I had Return still held down by the time it started up, and my release of it immediately terminated input :-) --- unix/gtkask.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/gtkask.c b/unix/gtkask.c index 0f62e9b8..de1bd4b7 100644 --- a/unix/gtkask.c +++ b/unix/gtkask.c @@ -61,9 +61,9 @@ static int last_char_len(struct askpass_ctx *ctx) static gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data) { struct askpass_ctx *ctx = (struct askpass_ctx *)data; - if (event->keyval == GDK_Return) { + if (event->keyval == GDK_Return && event->type == GDK_KEY_PRESS) { gtk_main_quit(); - } else if (event->keyval == GDK_Escape) { + } else if (event->keyval == GDK_Escape && event->type == GDK_KEY_PRESS) { smemclr(ctx->passphrase, ctx->passsize); ctx->passphrase = NULL; gtk_main_quit();