diff options
author | Tony Crisci <tony@dubstepdish.com> | 2017-12-16 19:16:00 -0500 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2017-12-16 19:16:00 -0500 |
commit | 0256cd1473a574c2eb087f420f8356fee9e08aa7 (patch) | |
tree | a0376d4fa0077648b2c4eb8c844e470245c9a421 | |
parent | get device id correctly (diff) | |
download | sway-0256cd1473a574c2eb087f420f8356fee9e08aa7.tar.gz sway-0256cd1473a574c2eb087f420f8356fee9e08aa7.tar.zst sway-0256cd1473a574c2eb087f420f8356fee9e08aa7.zip |
fix keyboard hotplugging
-rw-r--r-- | include/sway/input/keyboard.h | 1 | ||||
-rw-r--r-- | sway/input/keyboard.c | 5 |
2 files changed, 3 insertions, 3 deletions
diff --git a/include/sway/input/keyboard.h b/include/sway/input/keyboard.h index 0b0c1549..d9251f4c 100644 --- a/include/sway/input/keyboard.h +++ b/include/sway/input/keyboard.h | |||
@@ -5,7 +5,6 @@ | |||
5 | 5 | ||
6 | struct sway_keyboard { | 6 | struct sway_keyboard { |
7 | struct sway_seat_device *seat_device; | 7 | struct sway_seat_device *seat_device; |
8 | struct wl_list link; // sway_seat::keyboards | ||
9 | 8 | ||
10 | struct xkb_keymap *keymap; | 9 | struct xkb_keymap *keymap; |
11 | 10 | ||
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 | ||
105 | void sway_keyboard_destroy(struct sway_keyboard *keyboard) { | 105 | void 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 | } |