X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=i3lock.c;h=fd4d1d294275b54c5bc59ae816914c36676de149;hb=3f8b0a12c34328c3cd6f8897cd48e34930b09319;hp=602ccca78a91d5171de81eed2a95ccee9b37f006;hpb=f9c30db62b61672410f7729d88c85a99679a6f71;p=i3%2Fi3lock diff --git a/i3lock.c b/i3lock.c index 602ccca..fd4d1d2 100644 --- a/i3lock.c +++ b/i3lock.c @@ -445,6 +445,12 @@ static void handle_key_press(xcb_key_press_event_t *event) { return; default: skip_repeated_empty_password = false; + // A new password is being entered, but a previous one is pending. + // Discard the old one and clear the retry_verification flag. + if (retry_verification) { + retry_verification = false; + clear_input(); + } } switch (ksym) { @@ -656,7 +662,7 @@ static bool verify_png_image(const char *image_path) { // Check PNG header according to the specification, available at: // https://www.w3.org/TR/2003/REC-PNG-20031110/#5PNG-file-signature - static unsigned char PNG_REFERENCE_HEADER[8] = { 137, 80, 78, 71, 13, 10, 26, 10 }; + static unsigned char PNG_REFERENCE_HEADER[8] = {137, 80, 78, 71, 13, 10, 26, 10}; if (memcmp(PNG_REFERENCE_HEADER, png_header, sizeof(png_header)) != 0) { fprintf(stderr, "File \"%s\" does not start with a PNG header. i3lock currently only supports loading PNG files.\n", image_path); return false;