diff options
author | Tony Crisci <tony@dubstepdish.com> | 2017-12-19 05:36:17 -0500 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2017-12-19 05:36:17 -0500 |
commit | f35575f71dfab5be9a935bc5e21ca5ee5dc4c2c2 (patch) | |
tree | 6db0da5b4d14154b0d9ef708dc5e26068be9eecd | |
parent | dont set cursor image on motion (diff) | |
download | sway-f35575f71dfab5be9a935bc5e21ca5ee5dc4c2c2.tar.gz sway-f35575f71dfab5be9a935bc5e21ca5ee5dc4c2c2.tar.zst sway-f35575f71dfab5be9a935bc5e21ca5ee5dc4c2c2.zip |
handle keymap not found
-rw-r--r-- | sway/input/keyboard.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c index bb18edd2..724941d8 100644 --- a/sway/input/keyboard.c +++ b/sway/input/keyboard.c | |||
@@ -85,10 +85,19 @@ void sway_keyboard_configure(struct sway_keyboard *keyboard) { | |||
85 | return; | 85 | return; |
86 | } | 86 | } |
87 | 87 | ||
88 | xkb_keymap_unref(keyboard->keymap); | 88 | struct xkb_keymap *keymap = |
89 | keyboard->keymap = | ||
90 | xkb_keymap_new_from_names(context, &rules, XKB_KEYMAP_COMPILE_NO_FLAGS); | 89 | xkb_keymap_new_from_names(context, &rules, XKB_KEYMAP_COMPILE_NO_FLAGS); |
90 | |||
91 | if (!keymap) { | ||
92 | sway_log(L_DEBUG, "cannot configure keyboard: keymap does not exist"); | ||
93 | xkb_context_unref(context); | ||
94 | return; | ||
95 | } | ||
96 | |||
97 | xkb_keymap_unref(keyboard->keymap); | ||
98 | keyboard->keymap = keymap; | ||
91 | wlr_keyboard_set_keymap(wlr_device->keyboard, keyboard->keymap); | 99 | wlr_keyboard_set_keymap(wlr_device->keyboard, keyboard->keymap); |
100 | |||
92 | wlr_keyboard_set_repeat_info(wlr_device->keyboard, 25, 600); | 101 | wlr_keyboard_set_repeat_info(wlr_device->keyboard, 25, 600); |
93 | xkb_context_unref(context); | 102 | xkb_context_unref(context); |
94 | struct wlr_seat *seat = keyboard->seat_device->sway_seat->wlr_seat; | 103 | struct wlr_seat *seat = keyboard->seat_device->sway_seat->wlr_seat; |