diff options
| author | tiosgz <alamica@protonmail.com> | 2022-02-10 08:32:08 +0000 |
|---|---|---|
| committer | Simon Ser <contact@emersion.fr> | 2022-02-10 09:40:06 +0100 |
| commit | cdc057f09aed320dedc63a5f1845e193eeb0aaa3 (patch) | |
| tree | c78fdb9548d376bc80eed92f759a6a76fd4fb59d | |
| parent | 2f2173808a2f0a17b8013f5f6b4d7ac95d2d3891 (diff) | |
seat: NULL-check on keyboard.modifiers event
It can be sent before keyboard.keymap (for example
when running swaylock from a different tty), in
which case the xkb state isn't initialized yet.
| -rw-r--r-- | seat.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -86,6 +86,10 @@ static void keyboard_modifiers(void *data, struct wl_keyboard *wl_keyboard, uint32_t mods_locked, uint32_t group) { struct swaylock_seat *seat = data; struct swaylock_state *state = seat->state; + if (state->xkb.state == NULL) { + return; + } + int layout_same = xkb_state_layout_index_is_active(state->xkb.state, group, XKB_STATE_LAYOUT_EFFECTIVE); if (!layout_same) { |
