aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/layout.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2018-05-28 21:37:29 -0400
committerLibravatar Brian Ashworth <bosrsf04@gmail.com>2018-05-29 11:21:55 -0400
commit103a302fa409cf9ba88f5163280d73fbf886bca2 (patch)
tree94b4c42cf61bbbecbae2c27dbb86cacb159312ef /sway/tree/layout.c
parentFix breaking out of tabs/stacks (diff)
downloadsway-103a302fa409cf9ba88f5163280d73fbf886bca2.tar.gz
sway-103a302fa409cf9ba88f5163280d73fbf886bca2.tar.zst
sway-103a302fa409cf9ba88f5163280d73fbf886bca2.zip
Fix moving out of a tabbed/stacked workspace
Diffstat (limited to 'sway/tree/layout.c')
-rw-r--r--sway/tree/layout.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/sway/tree/layout.c b/sway/tree/layout.c
index 96501cc3..c2a338f9 100644
--- a/sway/tree/layout.c
+++ b/sway/tree/layout.c
@@ -313,15 +313,24 @@ static void move_out_of_tabs_stacks(struct sway_container *container,
313 struct sway_container *current, enum movement_direction move_dir, 313 struct sway_container *current, enum movement_direction move_dir,
314 int offs) { 314 int offs) {
315 wlr_log(L_DEBUG, "Moving out of tab/stack into a split"); 315 wlr_log(L_DEBUG, "Moving out of tab/stack into a split");
316 bool is_workspace = current->parent->type == C_WORKSPACE;
316 struct sway_container *old_parent = current->parent->parent; 317 struct sway_container *old_parent = current->parent->parent;
317 struct sway_container *new_parent = container_split(current->parent, 318 struct sway_container *new_parent = container_split(current->parent,
318 move_dir == MOVE_LEFT || move_dir == MOVE_RIGHT ? L_HORIZ : L_VERT); 319 move_dir == MOVE_LEFT || move_dir == MOVE_RIGHT ? L_HORIZ : L_VERT);
319 container_insert_child(new_parent, container, offs < 0 ? 0 : 1); 320 if (is_workspace) {
320 container_reap_empty_recursive(new_parent->parent); 321 container_insert_child(new_parent->parent, container, offs < 0 ? 0 : 1);
321 container_flatten(new_parent->parent); 322 } else {
322 wl_signal_emit(&current->events.reparent, old_parent); 323 container_insert_child(new_parent, container, offs < 0 ? 0 : 1);
324 container_reap_empty_recursive(new_parent->parent);
325 container_flatten(new_parent->parent);
326 }
327 wl_signal_emit(&container->events.reparent, old_parent);
323 container_create_notify(new_parent); 328 container_create_notify(new_parent);
324 arrange_children_of(new_parent); 329 if (is_workspace) {
330 arrange_workspace(new_parent->parent);
331 } else {
332 arrange_children_of(new_parent);
333 }
325} 334}
326 335
327void container_move(struct sway_container *container, 336void container_move(struct sway_container *container,