1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-25 01:02:24 +00:00

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 :-)
This commit is contained in:
Simon Tatham 2015-05-17 16:40:36 +01:00
parent 5de81cb035
commit 454fe4fdf7

View File

@ -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();