Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion sway/commands/move.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,9 @@ static bool container_move_in_direction(struct sway_container *container,
} else {
// Container will be promoted
struct sway_container *old_parent = container->pending.parent;
// The container's fractions were relative to its former parent.
container->pending.height = container->pending.width = 0;
container->height_fraction = container->width_fraction = 0;
if (ancestor->pending.parent) {
// Container will move in with its parent
container_insert_child(ancestor->pending.parent, container,
Expand All @@ -404,8 +407,8 @@ static bool container_move_in_direction(struct sway_container *container,
workspace_insert_tiling(ancestor->pending.workspace, container,
index + (offs < 0 ? 0 : 1));
}
// The ancestor remains in the same parent, so preserve its fractions.
ancestor->pending.height = ancestor->pending.width = 0;
ancestor->height_fraction = ancestor->width_fraction = 0;
if (old_parent) {
container_reap_empty(old_parent);
}
Expand Down