mirror of
https://github.com/swaywm/sway.git
synced 2026-06-08 03:02:23 -04:00
seatop_move_tiling: fix stack overflow when dropping container into itself
This change avoids a cyclic reference in the window tree when dragging a
container and dropping it into one of its descendants.
The drop target resolution logic previously only checked if the target node
was the container itself, but missed checking if the target was a descendant
of the dragged container.
Fixes: #7949
(cherry picked from commit f1b40bc288)
This commit is contained in:
parent
c205f85a4e
commit
c8e4af39a3
1 changed files with 3 additions and 2 deletions
|
|
@ -256,8 +256,9 @@ static void handle_motion_postthreshold(struct sway_seat *seat) {
|
||||||
}
|
}
|
||||||
if (edge) {
|
if (edge) {
|
||||||
e->target_node = node_get_parent(&con->node);
|
e->target_node = node_get_parent(&con->node);
|
||||||
if (e->target_node == &e->con->node) {
|
if (e->target_node && (e->target_node == &e->con->node ||
|
||||||
e->target_node = node_get_parent(e->target_node);
|
node_has_ancestor(e->target_node, &e->con->node))) {
|
||||||
|
e->target_node = node_get_parent(&e->con->node);
|
||||||
}
|
}
|
||||||
e->target_edge = edge;
|
e->target_edge = edge;
|
||||||
update_indicator(e, &box);
|
update_indicator(e, &box);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue