aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/seat.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2020-05-18 17:52:13 -0400
committerLibravatar Tudor Brindus <me@tbrindus.ca>2020-05-19 15:42:32 -0400
commit5c32a4845354e59133b1d213928d8cee1b8691bd (patch)
tree2b1aded3991d25558a91f8ec3b4b24dbd36e6ae4 /sway/input/seat.c
parentbash completion: swaymsg accepts --version, not --verbose (diff)
downloadsway-5c32a4845354e59133b1d213928d8cee1b8691bd.tar.gz
sway-5c32a4845354e59133b1d213928d8cee1b8691bd.tar.zst
sway-5c32a4845354e59133b1d213928d8cee1b8691bd.zip
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.
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r--sway/input/seat.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 1d45b256..233267e0 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -692,12 +692,7 @@ static void seat_configure_keyboard(struct sway_seat *seat,
692 if (!seat_device->keyboard) { 692 if (!seat_device->keyboard) {
693 sway_keyboard_create(seat, seat_device); 693 sway_keyboard_create(seat, seat_device);
694 } 694 }
695 if (!wlr_keyboard_group_from_wlr_keyboard( 695 sway_keyboard_configure(seat_device->keyboard);
696 seat_device->input_device->wlr_device->keyboard)) {
697 // Do not configure keyboard group keyboards. They will be configured
698 // based on the keyboards in the group.
699 sway_keyboard_configure(seat_device->keyboard);
700 }
701 wlr_seat_set_keyboard(seat->wlr_seat, 696 wlr_seat_set_keyboard(seat->wlr_seat,
702 seat_device->input_device->wlr_device); 697 seat_device->input_device->wlr_device);
703 struct sway_node *focus = seat_get_focus(seat); 698 struct sway_node *focus = seat_get_focus(seat);