diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-09-23 13:55:06 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-09-23 13:55:06 +1000 |
commit | 0b7fb6943ed7cc0be7f249c663966acf6c833299 (patch) | |
tree | 281eacca039238e3bfca7ed9131dde3888fa9723 /sway/commands | |
parent | 93624599b3252c0c8378d8e788a500b4b597a135 (diff) | |
download | sway-0b7fb6943ed7cc0be7f249c663966acf6c833299.tar.xz |
Fix some bugs as a result of removing move_out_of_tabs_stacks
Diffstat (limited to 'sway/commands')
-rw-r--r-- | sway/commands/move.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sway/commands/move.c b/sway/commands/move.c index 6e32c932..8bf85f9b 100644 --- a/sway/commands/move.c +++ b/sway/commands/move.c @@ -259,6 +259,12 @@ static void container_move_to_container(struct sway_container *container, * In other words, rejigger it. */ static void workspace_rejigger(struct sway_workspace *ws, struct sway_container *child, enum movement_direction move_dir) { + if (!child->parent && ws->tiling->length == 1) { + ws->layout = + move_dir == MOVE_LEFT || move_dir == MOVE_RIGHT ? L_HORIZ : L_VERT; + workspace_update_representation(ws); + return; + } container_detach(child); workspace_wrap_children(ws); @@ -343,10 +349,8 @@ static bool container_move_in_direction(struct sway_container *container, // Maybe rejigger the workspace struct sway_workspace *ws = container->workspace; if (!is_parallel(ws->layout, move_dir)) { - if (ws->tiling->length >= 2) { - workspace_rejigger(ws, container, move_dir); - return true; - } + workspace_rejigger(ws, container, move_dir); + return true; } else if (ws->layout == L_TABBED || ws->layout == L_STACKED) { workspace_rejigger(ws, container, move_dir); return true; |