aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/keyboard.c
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2017-12-16 19:16:00 -0500
committerLibravatar Tony Crisci <tony@dubstepdish.com>2017-12-16 19:16:00 -0500
commit0256cd1473a574c2eb087f420f8356fee9e08aa7 (patch)
treea0376d4fa0077648b2c4eb8c844e470245c9a421 /sway/input/keyboard.c
parentget device id correctly (diff)
downloadsway-0256cd1473a574c2eb087f420f8356fee9e08aa7.tar.gz
sway-0256cd1473a574c2eb087f420f8356fee9e08aa7.tar.zst
sway-0256cd1473a574c2eb087f420f8356fee9e08aa7.zip
fix keyboard hotplugging
Diffstat (limited to 'sway/input/keyboard.c')
-rw-r--r--sway/input/keyboard.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c
index b9b571a6..ce0df3c5 100644
--- a/sway/input/keyboard.c
+++ b/sway/input/keyboard.c
@@ -103,9 +103,10 @@ void sway_keyboard_configure(struct sway_keyboard *keyboard) {
103} 103}
104 104
105void sway_keyboard_destroy(struct sway_keyboard *keyboard) { 105void sway_keyboard_destroy(struct sway_keyboard *keyboard) {
106 xkb_keymap_unref(keyboard->keymap); 106 if (!keyboard) {
107 return;
108 }
107 wl_list_remove(&keyboard->keyboard_key.link); 109 wl_list_remove(&keyboard->keyboard_key.link);
108 wl_list_remove(&keyboard->keyboard_modifiers.link); 110 wl_list_remove(&keyboard->keyboard_modifiers.link);
109 wl_list_remove(&keyboard->link);
110 free(keyboard); 111 free(keyboard);
111} 112}