aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Ronan Pigott <rpigott@berkeley.edu>2020-11-02 12:09:45 -0700
committerLibravatar Tudor Brindus <me@tbrindus.ca>2020-12-20 00:58:42 -0500
commitb4850876dc609830575531fd6e0ca696c956ae94 (patch)
tree0f3c79927f65fc97f8022366b3654234a3b0e4fe
parentcommands/move: don't flatten on move; reap empty former parent instead (diff)
downloadsway-b4850876dc609830575531fd6e0ca696c956ae94.tar.gz
sway-b4850876dc609830575531fd6e0ca696c956ae94.tar.zst
sway-b4850876dc609830575531fd6e0ca696c956ae94.zip
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.
-rw-r--r--sway/commands/move.c10
-rw-r--r--sway/tree/container.c10
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,
276 return; 276 return;
277 } 277 }
278 container_detach(child); 278 container_detach(child);
279 workspace_wrap_children(ws); 279 struct sway_container *new_parent = workspace_wrap_children(ws);
280 280
281 int index = 281 int index =
282 move_dir == WLR_DIRECTION_LEFT || move_dir == WLR_DIRECTION_UP ? 0 : 1; 282 move_dir == WLR_DIRECTION_LEFT || move_dir == WLR_DIRECTION_UP ? 0 : 1;
283 workspace_insert_tiling(ws, child, index); 283 workspace_insert_tiling(ws, child, index);
284 container_flatten(new_parent);
284 ws->layout = 285 ws->layout =
285 move_dir == WLR_DIRECTION_LEFT || move_dir == WLR_DIRECTION_RIGHT ? 286 move_dir == WLR_DIRECTION_LEFT || move_dir == WLR_DIRECTION_RIGHT ?
286 L_HORIZ : L_VERT; 287 L_HORIZ : L_VERT;
@@ -340,11 +341,8 @@ static bool container_move_in_direction(struct sway_container *container,
340 container_insert_child(current->parent, container, 341 container_insert_child(current->parent, container,
341 index + (offs < 0 ? 0 : 1)); 342 index + (offs < 0 ? 0 : 1));
342 } else { 343 } else {
343 struct sway_workspace *ws = current->workspace; 344 workspace_insert_tiling(current->workspace, container,
344 workspace_insert_tiling(ws, 345 index + (offs < 0 ? 0 : 1));
345 container_split(container,
346 output_get_default_layout(ws->output)),
347 index + (offs < 0 ? 0 : 1));
348 } 346 }
349 return true; 347 return true;
350 } 348 }
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) {
1355 container_update_representation(old_parent); 1355 container_update_representation(old_parent);
1356 node_set_dirty(&old_parent->node); 1356 node_set_dirty(&old_parent->node);
1357 } else if (old_workspace) { 1357 } else if (old_workspace) {
1358 // We may have removed the last tiling child from the workspace. If the
1359 // workspace layout was e.g. tabbed, then at this point it may be just
1360 // H[]. So, reset it to the default (e.g. T[]) for next time.
1361 // But if we are evacuating a workspace with only sticky floating
1362 // containers, the workspace will already be detached from the output.
1363 if (old_workspace->output && !old_workspace->tiling->length) {
1364 old_workspace->layout =
1365 output_get_default_layout(old_workspace->output);
1366 }
1367
1368 workspace_update_representation(old_workspace); 1358 workspace_update_representation(old_workspace);
1369 node_set_dirty(&old_workspace->node); 1359 node_set_dirty(&old_workspace->node);
1370 } 1360 }