diff options
author | 2018-09-23 13:55:06 +1000 | |
---|---|---|
committer | 2018-09-23 13:55:06 +1000 | |
commit | 0b7fb6943ed7cc0be7f249c663966acf6c833299 (patch) | |
tree | 281eacca039238e3bfca7ed9131dde3888fa9723 /sway/commands | |
parent | Remove move_out_of_tabs_stacks (diff) | |
download | sway-0b7fb6943ed7cc0be7f249c663966acf6c833299.tar.gz sway-0b7fb6943ed7cc0be7f249c663966acf6c833299.tar.zst sway-0b7fb6943ed7cc0be7f249c663966acf6c833299.zip |
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, | |||
259 | * In other words, rejigger it. */ | 259 | * In other words, rejigger it. */ |
260 | static void workspace_rejigger(struct sway_workspace *ws, | 260 | static void workspace_rejigger(struct sway_workspace *ws, |
261 | struct sway_container *child, enum movement_direction move_dir) { | 261 | struct sway_container *child, enum movement_direction move_dir) { |
262 | if (!child->parent && ws->tiling->length == 1) { | ||
263 | ws->layout = | ||
264 | move_dir == MOVE_LEFT || move_dir == MOVE_RIGHT ? L_HORIZ : L_VERT; | ||
265 | workspace_update_representation(ws); | ||
266 | return; | ||
267 | } | ||
262 | container_detach(child); | 268 | container_detach(child); |
263 | workspace_wrap_children(ws); | 269 | workspace_wrap_children(ws); |
264 | 270 | ||
@@ -343,10 +349,8 @@ static bool container_move_in_direction(struct sway_container *container, | |||
343 | // Maybe rejigger the workspace | 349 | // Maybe rejigger the workspace |
344 | struct sway_workspace *ws = container->workspace; | 350 | struct sway_workspace *ws = container->workspace; |
345 | if (!is_parallel(ws->layout, move_dir)) { | 351 | if (!is_parallel(ws->layout, move_dir)) { |
346 | if (ws->tiling->length >= 2) { | 352 | workspace_rejigger(ws, container, move_dir); |
347 | workspace_rejigger(ws, container, move_dir); | 353 | return true; |
348 | return true; | ||
349 | } | ||
350 | } else if (ws->layout == L_TABBED || ws->layout == L_STACKED) { | 354 | } else if (ws->layout == L_TABBED || ws->layout == L_STACKED) { |
351 | workspace_rejigger(ws, container, move_dir); | 355 | workspace_rejigger(ws, container, move_dir); |
352 | return true; | 356 | return true; |