diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2019-11-24 20:41:18 +0000 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2019-11-24 20:41:18 +0000 |
| commit | 2a698d72640182bf13097dbd7537a037146d5188 (patch) | |
| tree | 0863882369bbd51fa18925a8bbe6db19413690c4 | |
| parent | 41dfe01f85c500389543a4f31e8a3c48aedf75db (diff) | |
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 41e06bbc4cbb53b5ff8c6fbce007c8d19af68b57
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) { // init the focus stack wl_list_init(&seat->focus_stack); + wl_list_init(&seat->devices); + root_for_each_workspace(collect_focus_workspace_iter, seat); root_for_each_container(collect_focus_container_iter, seat); @@ -526,7 +528,6 @@ struct sway_seat *seat_create(const char *seat_name) { seat->request_set_primary_selection.notify = handle_request_set_primary_selection; - wl_list_init(&seat->devices); wl_list_init(&seat->keyboard_groups); wl_list_insert(&server.input->seats, &seat->link); |
