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

View file

@ -918,7 +918,9 @@ void sway_keyboard_destroy(struct sway_keyboard *keyboard) {
if (!keyboard) { if (!keyboard) {
return; return;
} }
if (keyboard->seat_device->input_device->wlr_device->keyboard->group) {
sway_keyboard_group_remove(keyboard); sway_keyboard_group_remove(keyboard);
}
if (keyboard->keymap) { if (keyboard->keymap) {
xkb_keymap_unref(keyboard->keymap); xkb_keymap_unref(keyboard->keymap);
} }