mirror of
https://github.com/swaywm/sway.git
synced 2024-11-11 21:14:10 +01:00
Clean up tracked outputs when an output is destroyed
This commit is contained in:
parent
0f6d212629
commit
a49e4b13bf
@ -211,6 +211,14 @@ static struct sway_container *container_workspace_destroy(
|
||||
return output;
|
||||
}
|
||||
|
||||
static void untrack_output(struct sway_container *con, void *data) {
|
||||
struct sway_output *output = data;
|
||||
int index = list_find(con->outputs, output);
|
||||
if (index != -1) {
|
||||
list_del(con->outputs, index);
|
||||
}
|
||||
}
|
||||
|
||||
static struct sway_container *container_output_destroy(
|
||||
struct sway_container *output) {
|
||||
if (!sway_assert(output, "cannot destroy null output")) {
|
||||
@ -252,6 +260,8 @@ static struct sway_container *container_output_destroy(
|
||||
}
|
||||
}
|
||||
|
||||
root_for_each_container(untrack_output, output->sway_output);
|
||||
|
||||
wl_list_remove(&output->sway_output->mode.link);
|
||||
wl_list_remove(&output->sway_output->transform.link);
|
||||
wl_list_remove(&output->sway_output->scale.link);
|
||||
|
Loading…
Reference in New Issue
Block a user