diff options
author | Ronan Pigott <rpigott@berkeley.edu> | 2020-11-02 12:09:45 -0700 |
---|---|---|
committer | Tudor Brindus <me@tbrindus.ca> | 2020-12-20 00:58:42 -0500 |
commit | b4850876dc609830575531fd6e0ca696c956ae94 (patch) | |
tree | 0f3c79927f65fc97f8022366b3654234a3b0e4fe /sway | |
parent | 971aa90ccca33084238cf6025e51fe3205c714b5 (diff) |
Revert "commands/move: maintain workspace_layout when moving"
This is in preparation for changing the workspace_layout
command to work like it does in i3.
This reverts commit b4a75a1ab2a72842830aeea37733311f85e6f660.
Diffstat (limited to 'sway')
-rw-r--r-- | sway/commands/move.c | 10 | ||||
-rw-r--r-- | sway/tree/container.c | 10 |
2 files changed, 4 insertions, 16 deletions
diff --git a/sway/commands/move.c b/sway/commands/move.c index 247c45fe..32adf0bf 100644 --- a/sway/commands/move.c +++ b/sway/commands/move.c @@ -276,11 +276,12 @@ static void workspace_rejigger(struct sway_workspace *ws, return; } container_detach(child); - workspace_wrap_children(ws); + struct sway_container *new_parent = workspace_wrap_children(ws); int index = move_dir == WLR_DIRECTION_LEFT || move_dir == WLR_DIRECTION_UP ? 0 : 1; workspace_insert_tiling(ws, child, index); + container_flatten(new_parent); ws->layout = move_dir == WLR_DIRECTION_LEFT || move_dir == WLR_DIRECTION_RIGHT ? L_HORIZ : L_VERT; @@ -340,11 +341,8 @@ static bool container_move_in_direction(struct sway_container *container, container_insert_child(current->parent, container, index + (offs < 0 ? 0 : 1)); } else { - struct sway_workspace *ws = current->workspace; - workspace_insert_tiling(ws, - container_split(container, - output_get_default_layout(ws->output)), - index + (offs < 0 ? 0 : 1)); + workspace_insert_tiling(current->workspace, container, + index + (offs < 0 ? 0 : 1)); } return true; } diff --git a/sway/tree/container.c b/sway/tree/container.c index 3c8e2780..b0d23700 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -1355,16 +1355,6 @@ void container_detach(struct sway_container *child) { container_update_representation(old_parent); node_set_dirty(&old_parent->node); } else if (old_workspace) { - // We may have removed the last tiling child from the workspace. If the - // workspace layout was e.g. tabbed, then at this point it may be just - // H[]. So, reset it to the default (e.g. T[]) for next time. - // But if we are evacuating a workspace with only sticky floating - // containers, the workspace will already be detached from the output. - if (old_workspace->output && !old_workspace->tiling->length) { - old_workspace->layout = - output_get_default_layout(old_workspace->output); - } - workspace_update_representation(old_workspace); node_set_dirty(&old_workspace->node); } |