aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2019-12-12 23:39:00 -0500
committerFurkan Sahin <furkan-dev@proton.me>2019-12-12 23:39:00 -0500
commit26d3b5735e41a9108448aac6ddf8ad996a7ba2c2 (patch)
treea8dd464d084b50de93bb66e35b74099ca17ed7a7
parent202394accff916daf327f3119f8e4cb021c5bba7 (diff)
input/keyboard: remove group listeners on destroy
This adds two missing calls to wl_list_remove to remove the key and modifier listeners for the keyboard group's keyboard when destroying the keyboard group. This fixes some crashes when changing the keymap of the last keyboard in a group with a keyboard binding.
-rw-r--r--sway/input/keyboard.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c
index 1d55c165..cac713ad 100644
--- a/sway/input/keyboard.c
+++ b/sway/input/keyboard.c
@@ -675,6 +675,8 @@ static void sway_keyboard_group_remove(struct sway_keyboard *keyboard) {
struct sway_keyboard_group *sway_group = wlr_group->data;
wlr_group->data = NULL;
wl_list_remove(&sway_group->link);
+ wl_list_remove(&sway_group->keyboard_key.link);
+ wl_list_remove(&sway_group->keyboard_modifiers.link);
sway_keyboard_destroy(sway_group->seat_device->keyboard);
free(sway_group->seat_device->input_device);
free(sway_group->seat_device);