aboutsummaryrefslogtreecommitdiff
path: root/sway/tree/container.c
diff options
context:
space:
mode:
authorTudor Brindus <me@tbrindus.ca>2020-07-01 03:20:38 -0400
committerBrian Ashworth <bosrsf04@gmail.com>2020-07-03 18:40:59 -0400
commitb4a75a1ab2a72842830aeea37733311f85e6f660 (patch)
treef011ff5d7040f33c3ac1c0b858c59e39260f9fbb /sway/tree/container.c
parent17ff13fc84fd74ddcee68a302af156d7bf81ed85 (diff)
commands/move: maintain workspace_layout when moving
Fixes #5157.
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r--sway/tree/container.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 4cc42747..fa1598ef 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -1329,6 +1329,14 @@ 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.
+ if (!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);
}