From 5c32a4845354e59133b1d213928d8cee1b8691bd Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Mon, 18 May 2020 17:52:13 -0400 Subject: input: fix reloading crash due to keyboard group configuring Keyboard group keyboards should not call sway_keyboard_configure. They do not have an input config and they derive their state from the keyboards within the group. For some reason, I got sway_keyboard_configure and seat_configure_keyboard mixed up and thought seat_reset_device called the latter. Calling sway_keyboard_configure with a keyboard group's keyboard is not supported and can cause issues. If any clients are listening to the ipc input event, a sigsegv will occur due to not every property - such as identifier - being wired up for keyboard group keyboard's. This also adds an assertion to sway_keyboard_configure to ensure that this does not occur in the future and any instances are quickly caught. --- sway/input/input-manager.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'sway/input/input-manager.c') diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c index c576a593..b900f666 100644 --- a/sway/input/input-manager.c +++ b/sway/input/input-manager.c @@ -558,13 +558,12 @@ void input_manager_reset_all_inputs() { // If there is at least one keyboard using the default keymap, repeat delay, // and repeat rate, then it is possible that there is a keyboard group that - // needs to be reset. This will disarm the keyboards as well as exit and - // re-enter any focus views. + // need their keyboard disarmed. struct sway_seat *seat; wl_list_for_each(seat, &server.input->seats, link) { struct sway_keyboard_group *group; wl_list_for_each(group, &seat->keyboard_groups, link) { - seat_reset_device(seat, group->seat_device->input_device); + sway_keyboard_disarm_key_repeat(group->seat_device->keyboard); } } } -- cgit v1.2.3-54-g00ecf