diff options
author | Paul Riou <paul.riou@nhs.net> | 2019-11-24 20:41:18 +0000 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2019-11-24 21:51:06 +0100 |
commit | 3334d11adc926c0f6d86afc4897117d5559036f5 (patch) | |
tree | 0863882369bbd51fa18925a8bbe6db19413690c4 | |
parent | Amend typos (diff) | |
download | sway-3334d11adc926c0f6d86afc4897117d5559036f5.tar.gz sway-3334d11adc926c0f6d86afc4897117d5559036f5.tar.zst sway-3334d11adc926c0f6d86afc4897117d5559036f5.zip |
input: seat: Fix seat device list not initialised before use
When being created, non first seats would get through the list of devices
without the list being first initialised -> segfault.
Issue introduced with ab0248a54564b2f644b6fb367f9eb44fe0bf5f3c
Fixes #4750: Crash when reloading Sway with multiple seats configured
-rw-r--r-- | sway/input/seat.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index fb3e68ee..bc72ff0c 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -494,6 +494,8 @@ struct sway_seat *seat_create(const char *seat_name) { | |||
494 | // init the focus stack | 494 | // init the focus stack |
495 | wl_list_init(&seat->focus_stack); | 495 | wl_list_init(&seat->focus_stack); |
496 | 496 | ||
497 | wl_list_init(&seat->devices); | ||
498 | |||
497 | root_for_each_workspace(collect_focus_workspace_iter, seat); | 499 | root_for_each_workspace(collect_focus_workspace_iter, seat); |
498 | root_for_each_container(collect_focus_container_iter, seat); | 500 | root_for_each_container(collect_focus_container_iter, seat); |
499 | 501 | ||
@@ -526,7 +528,6 @@ struct sway_seat *seat_create(const char *seat_name) { | |||
526 | seat->request_set_primary_selection.notify = | 528 | seat->request_set_primary_selection.notify = |
527 | handle_request_set_primary_selection; | 529 | handle_request_set_primary_selection; |
528 | 530 | ||
529 | wl_list_init(&seat->devices); | ||
530 | wl_list_init(&seat->keyboard_groups); | 531 | wl_list_init(&seat->keyboard_groups); |
531 | 532 | ||
532 | wl_list_insert(&server.input->seats, &seat->link); | 533 | wl_list_insert(&server.input->seats, &seat->link); |