From 66bd7af3e59e509000b8a55a9429e7a8e133fd81 Mon Sep 17 00:00:00 2001 From: Simeon Simeonov Date: Tue, 14 Mar 2023 23:30:32 +0100 Subject: Sync with upstream 2.14.1 and update the documentation --- i3lock.c | 47 ++++++----------------------------------------- 1 file changed, 6 insertions(+), 41 deletions(-) (limited to 'i3lock.c') diff --git a/i3lock.c b/i3lock.c index 48edddb..aee9b2a 100644 --- a/i3lock.c +++ b/i3lock.c @@ -1,6 +1,6 @@ /* * This file is part of i3lock-extended - * Copyright (C) 2020 Simeon Simeonov + * Copyright (C) 2020-2023 Simeon Simeonov * i3lock-extended is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -106,7 +106,7 @@ i3lock_led_clock_t i3lock_led_clock = {"ffff00", char *display_text = NULL; #endif -char color[7] = "ffffff"; +char color[7] = "a3a3a3"; uint32_t last_resolution[2]; xcb_window_t win; static xcb_cursor_t cursor; @@ -132,9 +132,9 @@ int failed_attempts = 0; bool show_failed_attempts = false; bool retry_verification = false; -static struct xkb_state *xkb_state; +struct xkb_state *xkb_state; static struct xkb_context *xkb_context; -static struct xkb_keymap *xkb_keymap; +struct xkb_keymap *xkb_keymap; static struct xkb_compose_table *xkb_compose_table; static struct xkb_compose_state *xkb_compose_state; static uint8_t xkb_base_event; @@ -360,41 +360,6 @@ static void input_done(void) { if (debug_mode) fprintf(stderr, "Authentication failure\n"); - /* Get state of Caps and Num lock modifiers, to be displayed in - * STATE_AUTH_WRONG state */ - xkb_mod_index_t idx, num_mods; - const char *mod_name; - - num_mods = xkb_keymap_num_mods(xkb_keymap); - - for (idx = 0; idx < num_mods; idx++) { - if (!xkb_state_mod_index_is_active(xkb_state, idx, XKB_STATE_MODS_EFFECTIVE)) - continue; - - mod_name = xkb_keymap_mod_get_name(xkb_keymap, idx); - if (mod_name == NULL) - continue; - - /* Replace certain xkb names with nicer, human-readable ones. */ - if (strcmp(mod_name, XKB_MOD_NAME_CAPS) == 0) - mod_name = "Caps Lock"; - else if (strcmp(mod_name, XKB_MOD_NAME_ALT) == 0) - mod_name = "Alt"; - else if (strcmp(mod_name, XKB_MOD_NAME_NUM) == 0) - mod_name = "Num Lock"; - else if (strcmp(mod_name, XKB_MOD_NAME_LOGO) == 0) - mod_name = "Super"; - - char *tmp; - if (modifier_string == NULL) { - if (asprintf(&tmp, "%s", mod_name) != -1) - modifier_string = tmp; - } else if (asprintf(&tmp, "%s, %s", modifier_string, mod_name) != -1) { - free(modifier_string); - modifier_string = tmp; - } - } - auth_state = STATE_AUTH_WRONG; failed_attempts += 1; clear_input(); @@ -459,7 +424,7 @@ static void handle_key_press(xcb_key_press_event_t *event) { return; case XKB_COMPOSE_COMPOSED: /* xkb_compose_state_get_utf8 doesn't include the terminating byte in the return value - * as xkb_keysym_to_utf8 does. Adding one makes the variable n consistent. */ + * as xkb_keysym_to_utf8 does. Adding one makes the variable n consistent. */ n = xkb_compose_state_get_utf8(xkb_compose_state, buffer, sizeof(buffer)) + 1; ksym = xkb_compose_state_get_one_sym(xkb_compose_state); composed = true; @@ -1131,7 +1096,7 @@ int main(int argc, char *argv[]) { while ((o = getopt_long(argc, argv, optstring, longopts, &longoptind)) != -1) { switch (o) { case 'v': - errx(EXIT_SUCCESS, "version " I3LOCK_VERSION " © 2010 Michael Stapelberg, 2017-2020 Simeon Simeonov"); + errx(EXIT_SUCCESS, "version " I3LOCK_VERSION " © 2010 Michael Stapelberg, 2020-2023 Simeon Simeonov"); case 'n': dont_fork = true; break; -- cgit v1.3