From 90e3d25009a201363e5cbe001f344f97f7f7c579 Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Mon, 25 Nov 2019 21:36:26 -0500 Subject: [PATCH] input/keyboard: check keyboard group before remove In sway_keyboard_destroy, only remove the keyboard from a keyboard group, if it is part of a keyboard group. If the keyboard is not part of a keyboard group, then there is nothing to remove it from --- sway/input/keyboard.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c index e925c00d..a42ce911 100644 --- a/sway/input/keyboard.c +++ b/sway/input/keyboard.c @@ -918,7 +918,9 @@ void sway_keyboard_destroy(struct sway_keyboard *keyboard) { if (!keyboard) { return; } - sway_keyboard_group_remove(keyboard); + if (keyboard->seat_device->input_device->wlr_device->keyboard->group) { + sway_keyboard_group_remove(keyboard); + } if (keyboard->keymap) { xkb_keymap_unref(keyboard->keymap); }