Revert "sway/tree: Simplify sway_node teardown"

This reverts commit e28e6484e8.

This change tried to remove nodes from all points of reference to allow
immediate destruction. However, it missed things like the children lists
cloned by transaction states of parent nodes.

Adding all that extra cleanup would not be in the spirit of a PR
claiming to simplify teardown. Let's wait for someone to come up with a
cleaner approach instead.

Fixes: https://github.com/swaywm/sway/pull/8738
This commit is contained in:
Kenny Levinsen 2025-06-28 10:51:51 +02:00 committed by Simon Ser
parent 0cd45d4ad2
commit 56f2db062d
16 changed files with 149 additions and 125 deletions

View file

@ -155,6 +155,8 @@ struct sway_container *container_create(struct sway_view *view);
void container_destroy(struct sway_container *con);
void container_begin_destroy(struct sway_container *con);
/**
* Search a container's descendants a container based on test criteria. Returns
* the first container that passes the test.

View file

@ -39,6 +39,7 @@ struct sway_node {
struct sway_transaction_instruction *instruction;
size_t ntxnrefs;
bool destroying;
// If true, indicates that the container has pending state that differs from
// the current.

View file

@ -101,6 +101,8 @@ struct sway_view {
struct wl_listener foreign_close_request;
struct wl_listener foreign_destroy;
bool destroying;
list_t *executed_criteria; // struct criteria *
union {
@ -294,6 +296,8 @@ bool view_init(struct sway_view *view, enum sway_view_type type,
void view_destroy(struct sway_view *view);
void view_begin_destroy(struct sway_view *view);
/**
* Map a view, ie. make it visible in the tree.
*

View file

@ -62,7 +62,9 @@ struct sway_workspace *workspace_create(struct sway_output *output,
void workspace_destroy(struct sway_workspace *workspace);
bool workspace_consider_destroy(struct sway_workspace *ws);
void workspace_begin_destroy(struct sway_workspace *workspace);
void workspace_consider_destroy(struct sway_workspace *ws);
char *workspace_next_name(const char *output_name);