1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2025-04-14 17:53:25 -04:00

wm/tree: clear managed window object when a toplevel node is detached

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2024-06-26 22:09:48 +01:00
parent bb5d026a6f
commit 7675a015bd
No known key found for this signature in database
GPG key ID: D3A4405BE6CC17F4

View file

@ -294,6 +294,7 @@ void wm_tree_detach(struct wm_tree *tree, struct wm_tree_node *subroot) {
zombie->id = subroot->id;
zombie->is_zombie = true;
zombie->win = subroot->win;
subroot->win = NULL;
list_init_head(&zombie->children);
list_replace(&subroot->siblings, &zombie->siblings);
wm_tree_enqueue_change(tree, (struct wm_tree_change){
@ -315,9 +316,6 @@ void wm_tree_attach(struct wm_tree *tree, struct wm_tree_node *child,
auto toplevel = wm_tree_find_toplevel_for(child);
if (child == toplevel) {
// This node could have a stale `->win` if it was a toplevel at
// some point in the past.
child->win = NULL;
wm_tree_enqueue_change(tree, (struct wm_tree_change){
.toplevel = child->id,
.type = WM_TREE_CHANGE_TOPLEVEL_NEW,