diff options
author | Mikkel Oscar Lyderik <[email protected]> | 2016-04-01 21:39:15 +0200 |
---|---|---|
committer | Mikkel Oscar Lyderik <[email protected]> | 2016-04-25 00:00:49 +0200 |
commit | a0cebb7c5a0530414e85c85fb0231881f988df7c (patch) | |
tree | d2f58758747730cb79d5cc053b6b15300ea51fe8 /sway/layout.c | |
parent | d26658fb355fdf7feee2d6aa801e487502e6ce8b (diff) |
Improve move command with tabbed/stacked layout
Diffstat (limited to 'sway/layout.c')
-rw-r--r-- | sway/layout.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sway/layout.c b/sway/layout.c index 261e2138..e9eb8add 100644 --- a/sway/layout.c +++ b/sway/layout.c @@ -244,7 +244,9 @@ void move_container(swayc_t *container, enum movement_direction dir) { while (true) { sway_log(L_DEBUG, "container:%p, parent:%p, child %p,", container,parent,child); - if (parent->layout == layout) { + if (parent->layout == layout + || (parent->layout == L_TABBED && layout == L_HORIZ) + || (parent->layout == L_STACKED && layout == L_VERT)) { int diff; // If it has ascended (parent has moved up), no container is removed // so insert it at index, or index+1. @@ -264,9 +266,11 @@ void move_container(swayc_t *container, enum movement_direction dir) { // Move container into sibling container if (child->type == C_CONTAINER) { parent = child; - // Insert it in first/last if matching layout,otherwise + // Insert it in first/last if matching layout, otherwise // inesrt it next to focused container - if (parent->layout == layout) { + if (parent->layout == layout + || (parent->layout == L_TABBED && layout == L_HORIZ) + || (parent->layout == L_STACKED && layout == L_VERT)) { desired = (diff < 0) * parent->children->length; } else { desired = index_child(child->focused); @@ -300,7 +304,7 @@ void move_container(swayc_t *container, enum movement_direction dir) { parent = child->parent; } // Dirty hack to fix a certain case - arrange_windows(parent, -1, -1); + /* arrange_windows(parent, -1, -1); */ arrange_windows(parent->parent, -1, -1); set_focused_container_for(parent->parent, container); } |