mirror of
https://github.com/swaywm/sway.git
synced 2024-11-19 14:39:15 +00:00
seatop_move_tiling: use tab/stack parent not self
When moving a descendant of a tabbed or stacked container, it is possible for the target node to be the node being moved. This causes a segfault in `handle_finish` since the node will be detached and then attempted to be attached to it own parent, which is NULL due to the detach. In this case, the target node should not be set to the node being moved, but the parent of the node. This also allows for a descendant of a tabbed or stacked container to be dragged out of the tabs/stacks and to be a sibling of the tabbbed/stacked container, which was not previously possible.
This commit is contained in:
parent
ad34837dda
commit
1d4b995c0f
|
@ -150,6 +150,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) {
|
||||||
|
e->target_node = node_get_parent(e->target_node);
|
||||||
|
}
|
||||||
e->target_edge = edge;
|
e->target_edge = edge;
|
||||||
node_get_box(e->target_node, &e->drop_box);
|
node_get_box(e->target_node, &e->drop_box);
|
||||||
resize_box(&e->drop_box, edge, DROP_LAYOUT_BORDER);
|
resize_box(&e->drop_box, edge, DROP_LAYOUT_BORDER);
|
||||||
|
|
Loading…
Reference in a new issue