sway

i3-compatible Wayland compositor
git clone https://git.awy.one/sway
Log | Files | Refs | README | LICENSE

commit 88f08a42f30c6d79adbc9c1d5d897113fcd3a6f4
parent b28e6d23698c98d616710c44a211a8121943b3ca
Author: Drew DeVault <sir@cmpwn.com>
Date:   Fri, 30 Mar 2018 14:31:17 -0400

Fix segfault when reaping invisible workspaces

Diffstat:
Msway/tree/container.c | 2+-
Msway/tree/layout.c | 4+++-
2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/sway/tree/container.c b/sway/tree/container.c @@ -79,7 +79,7 @@ struct sway_container *container_destroy(struct sway_container *cont) { list_free(cont->marks); } if (parent) { - container_remove_child(cont); + parent = container_remove_child(cont); } if (cont->name) { free(cont->name); diff --git a/sway/tree/layout.c b/sway/tree/layout.c @@ -110,9 +110,11 @@ struct sway_container *container_reap_empty(struct sway_container *container) { while (container->children->length == 0) { if (container->type == C_WORKSPACE) { if (!workspace_is_visible(container)) { + struct sway_container *parent = container->parent; container_workspace_destroy(container); + return parent; } - break; + return container; } else if (container->type == C_CONTAINER) { struct sway_container *parent = container->parent; container_destroy(container);