mirror of
https://github.com/swaywm/sway.git
synced 2024-11-26 18:01:29 +00:00
Don't rejigger if parent has two children
This commit is contained in:
parent
37b173f326
commit
93ca8919f6
|
@ -331,11 +331,17 @@ void container_move(struct sway_container *container,
|
|||
}
|
||||
case C_WORKSPACE:
|
||||
if (!is_parallel(current->layout, move_dir)) {
|
||||
if (current->children->length != 1) {
|
||||
// Special case
|
||||
if (current->children->length > 2) {
|
||||
wlr_log(L_DEBUG, "Rejiggering the workspace (%d kiddos)",
|
||||
current->children->length);
|
||||
workspace_rejigger(current, container, move_dir);
|
||||
} else if (current->children->length == 2) {
|
||||
wlr_log(L_DEBUG, "Changing workspace layout");
|
||||
container_set_layout(current,
|
||||
move_dir == MOVE_LEFT || move_dir == MOVE_RIGHT ?
|
||||
L_HORIZ : L_VERT);
|
||||
container_insert_child(current, container, offs < 0 ? 0 : 1);
|
||||
arrange_windows(current, -1, -1);
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue