X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=i3lock.c;h=fd4d1d294275b54c5bc59ae816914c36676de149;hb=f74c0135769227e1a9719c0eb04784db6437d34c;hp=2bf3901bf82a792a9666653d7c99046b74975e50;hpb=bcbfee0a1777c301cd4b6e423b1212d718092355;p=i3%2Fi3lock diff --git a/i3lock.c b/i3lock.c index 2bf3901..fd4d1d2 100644 --- a/i3lock.c +++ b/i3lock.c @@ -46,6 +46,7 @@ #include "cursors.h" #include "unlock_indicator.h" #include "randr.h" +#include "dpi.h" #define TSTAMP_N_SECS(n) (n * 1.0) #define TSTAMP_N_MINS(n) (60 * TSTAMP_N_SECS(n)) @@ -444,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) { @@ -655,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; @@ -1033,6 +1040,8 @@ int main(int argc, char *argv[]) { screen = xcb_setup_roots_iterator(xcb_get_setup(conn)).data; + init_dpi(); + randr_init(&randr_base, screen->root); randr_query(screen->root);