aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/keyboard.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-11-25 21:36:26 -0500
committerLibravatar Simon Ser <contact@emersion.fr>2019-11-26 11:31:55 +0100
commit90e3d25009a201363e5cbe001f344f97f7f7c579 (patch)
tree0f3b9429e18dbb30dc935f84ffbb92bfa935f2ec /sway/input/keyboard.c
parentinput: seat: Fix seat device list not initialised before use (diff)
downloadsway-90e3d25009a201363e5cbe001f344f97f7f7c579.tar.gz
sway-90e3d25009a201363e5cbe001f344f97f7f7c579.tar.zst
sway-90e3d25009a201363e5cbe001f344f97f7f7c579.zip
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
Diffstat (limited to 'sway/input/keyboard.c')
-rw-r--r--sway/input/keyboard.c4
1 files changed, 3 insertions, 1 deletions
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) {
918 if (!keyboard) { 918 if (!keyboard) {
919 return; 919 return;
920 } 920 }
921 sway_keyboard_group_remove(keyboard); 921 if (keyboard->seat_device->input_device->wlr_device->keyboard->group) {
922 sway_keyboard_group_remove(keyboard);
923 }
922 if (keyboard->keymap) { 924 if (keyboard->keymap) {
923 xkb_keymap_unref(keyboard->keymap); 925 xkb_keymap_unref(keyboard->keymap);
924 } 926 }