diff options
Diffstat (limited to 'unlock_indicator.c')
| -rw-r--r-- | unlock_indicator.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/unlock_indicator.c b/unlock_indicator.c index 7d620fd..33b9406 100644 --- a/unlock_indicator.c +++ b/unlock_indicator.c | |||
| @@ -186,12 +186,14 @@ static void check_modifier_keys(void) { | |||
| 186 | num_mods = xkb_keymap_num_mods(xkb_keymap); | 186 | num_mods = xkb_keymap_num_mods(xkb_keymap); |
| 187 | 187 | ||
| 188 | for (idx = 0; idx < num_mods; idx++) { | 188 | for (idx = 0; idx < num_mods; idx++) { |
| 189 | if (!xkb_state_mod_index_is_active(xkb_state, idx, XKB_STATE_MODS_EFFECTIVE)) | 189 | if (!xkb_state_mod_index_is_active(xkb_state, idx, XKB_STATE_MODS_EFFECTIVE)) { |
| 190 | continue; | 190 | continue; |
| 191 | } | ||
| 191 | 192 | ||
| 192 | mod_name = xkb_keymap_mod_get_name(xkb_keymap, idx); | 193 | mod_name = xkb_keymap_mod_get_name(xkb_keymap, idx); |
| 193 | if (mod_name == NULL) | 194 | if (mod_name == NULL) { |
| 194 | continue; | 195 | continue; |
| 196 | } | ||
| 195 | 197 | ||
| 196 | /* Replace certain xkb names with nicer, human-readable ones. */ | 198 | /* Replace certain xkb names with nicer, human-readable ones. */ |
| 197 | if (strcmp(mod_name, XKB_MOD_NAME_CAPS) == 0) { | 199 | if (strcmp(mod_name, XKB_MOD_NAME_CAPS) == 0) { |
| @@ -218,8 +220,9 @@ void draw_image(xcb_pixmap_t bg_pixmap, uint32_t *resolution) { | |||
| 218 | DEBUG("scaling_factor is %.f, physical diameter is %d px\n", | 220 | DEBUG("scaling_factor is %.f, physical diameter is %d px\n", |
| 219 | scaling_factor, button_diameter_physical); | 221 | scaling_factor, button_diameter_physical); |
| 220 | 222 | ||
| 221 | if (!vistype) | 223 | if (!vistype) { |
| 222 | vistype = get_root_visual_type(screen); | 224 | vistype = get_root_visual_type(screen); |
| 225 | } | ||
| 223 | 226 | ||
| 224 | /* Initialize cairo: Create one in-memory surface to render the unlock | 227 | /* Initialize cairo: Create one in-memory surface to render the unlock |
| 225 | * indicator on, create one XCB surface to actually draw (one or more, | 228 | * indicator on, create one XCB surface to actually draw (one or more, |
| @@ -534,7 +537,8 @@ void redraw_screen(void) { | |||
| 534 | void clear_indicator(void) { | 537 | void clear_indicator(void) { |
| 535 | if (input_position == 0) { | 538 | if (input_position == 0) { |
| 536 | unlock_state = STATE_STARTED; | 539 | unlock_state = STATE_STARTED; |
| 537 | } else | 540 | } else { |
| 538 | unlock_state = STATE_KEY_PRESSED; | 541 | unlock_state = STATE_KEY_PRESSED; |
| 542 | } | ||
| 539 | redraw_screen(); | 543 | redraw_screen(); |
| 540 | } | 544 | } |
