aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-08-20 09:23:34 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-08-20 09:23:34 +1000
commita49e4b13bf16bda8f1877272e04935329bb682c2 (patch)
treeaf9630337cedbc0805567dfc6e612c1d7cb8c802 /sway
parent0f6d212629964c6a131b5675fa6c9f4d48da43aa (diff)
Clean up tracked outputs when an output is destroyed
Diffstat (limited to 'sway')
-rw-r--r--sway/tree/container.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 80d3f524..b932925d 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -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);