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
This commit is contained in:
Brian Ashworth 2019-11-25 21:36:26 -05:00 committed by Simon Ser
parent 3334d11adc
commit 90e3d25009
1 changed files with 3 additions and 1 deletions

View File

@ -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);
}