diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-05-31 22:11:12 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-31 22:11:12 -0400 |
commit | 4495ec64b2c41ba890d7982d1cf60a3099eb4c97 (patch) | |
tree | 7e478c7774d2ce0f3a03b15e4c6c49049ff66b1d /sway | |
parent | 536773e3a1dab6662d371f0f7ee462a4802ae6df (diff) | |
parent | e13c94f2dd375fee943bf676ab65ecf2b7cffbde (diff) |
Merge pull request #2079 from RedSoxFan/fix-2078
Fix moving out of tab/stack when only child
Diffstat (limited to 'sway')
-rw-r--r-- | sway/tree/layout.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sway/tree/layout.c b/sway/tree/layout.c index 9594b75a..b175f567 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c @@ -312,6 +312,19 @@ static void workspace_rejigger(struct sway_container *ws, static void move_out_of_tabs_stacks(struct sway_container *container, struct sway_container *current, enum movement_direction move_dir, int offs) { + if (container->parent == current->parent + && current->parent->children->length == 1) { + wlr_log(L_DEBUG, "Changing layout of %zd", current->parent->id); + current->parent->layout = move_dir == + MOVE_LEFT || move_dir == MOVE_RIGHT ? L_HORIZ : L_VERT; + if (current->parent->type == C_WORKSPACE) { + arrange_workspace(current->parent); + } else { + arrange_children_of(current->parent); + } + return; + } + wlr_log(L_DEBUG, "Moving out of tab/stack into a split"); bool is_workspace = current->parent->type == C_WORKSPACE; struct sway_container *old_parent = current->parent->parent; |