diff options
author | 2020-01-16 21:26:15 -0500 | |
---|---|---|
committer | 2020-01-16 19:55:24 -0700 | |
commit | 9d827ef493ae71e614f07013e4df264423623eba (patch) | |
tree | eca3d59402ceea1418199bc633a5b75b48fa85b8 /sway | |
parent | cmd_split: Refuse to split scratchpad hidden split containers (diff) | |
download | sway-9d827ef493ae71e614f07013e4df264423623eba.tar.gz sway-9d827ef493ae71e614f07013e4df264423623eba.tar.zst sway-9d827ef493ae71e614f07013e4df264423623eba.zip |
output: apply oc to outputs using wl_for_each_safe
If applying an output config to an output fails, the output may be
destroyed. To be able to handle this situation correctly,
apply_output_config_to_outputs needs to use wl_list_for_each_safe.
Diffstat (limited to 'sway')
-rw-r--r-- | sway/config/output.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/config/output.c b/sway/config/output.c index 8ea6c9f4..ec21b512 100644 --- a/sway/config/output.c +++ b/sway/config/output.c | |||
@@ -550,8 +550,8 @@ void apply_output_config_to_outputs(struct output_config *oc) { | |||
550 | // will be applied during normal "new output" event from wlroots. | 550 | // will be applied during normal "new output" event from wlroots. |
551 | bool wildcard = strcmp(oc->name, "*") == 0; | 551 | bool wildcard = strcmp(oc->name, "*") == 0; |
552 | char id[128]; | 552 | char id[128]; |
553 | struct sway_output *sway_output; | 553 | struct sway_output *sway_output, *tmp; |
554 | wl_list_for_each(sway_output, &root->all_outputs, link) { | 554 | wl_list_for_each_safe(sway_output, tmp, &root->all_outputs, link) { |
555 | char *name = sway_output->wlr_output->name; | 555 | char *name = sway_output->wlr_output->name; |
556 | output_get_identifier(id, sizeof(id), sway_output); | 556 | output_get_identifier(id, sizeof(id), sway_output); |
557 | if (wildcard || !strcmp(name, oc->name) || !strcmp(id, oc->name)) { | 557 | if (wildcard || !strcmp(name, oc->name) || !strcmp(id, oc->name)) { |