summaryrefslogtreecommitdiffstats
path: root/sway/layout.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/layout.c')
-rw-r--r--sway/layout.c12
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) {
244 while (true) { 244 while (true) {
245 sway_log(L_DEBUG, "container:%p, parent:%p, child %p,", 245 sway_log(L_DEBUG, "container:%p, parent:%p, child %p,",
246 container,parent,child); 246 container,parent,child);
247 if (parent->layout == layout) { 247 if (parent->layout == layout
248 || (parent->layout == L_TABBED && layout == L_HORIZ)
249 || (parent->layout == L_STACKED && layout == L_VERT)) {
248 int diff; 250 int diff;
249 // If it has ascended (parent has moved up), no container is removed 251 // If it has ascended (parent has moved up), no container is removed
250 // so insert it at index, or index+1. 252 // so insert it at index, or index+1.
@@ -264,9 +266,11 @@ void move_container(swayc_t *container, enum movement_direction dir) {
264 // Move container into sibling container 266 // Move container into sibling container
265 if (child->type == C_CONTAINER) { 267 if (child->type == C_CONTAINER) {
266 parent = child; 268 parent = child;
267 // Insert it in first/last if matching layout,otherwise 269 // Insert it in first/last if matching layout, otherwise
268 // inesrt it next to focused container 270 // inesrt it next to focused container
269 if (parent->layout == layout) { 271 if (parent->layout == layout
272 || (parent->layout == L_TABBED && layout == L_HORIZ)
273 || (parent->layout == L_STACKED && layout == L_VERT)) {
270 desired = (diff < 0) * parent->children->length; 274 desired = (diff < 0) * parent->children->length;
271 } else { 275 } else {
272 desired = index_child(child->focused); 276 desired = index_child(child->focused);
@@ -300,7 +304,7 @@ void move_container(swayc_t *container, enum movement_direction dir) {
300 parent = child->parent; 304 parent = child->parent;
301 } 305 }
302 // Dirty hack to fix a certain case 306 // Dirty hack to fix a certain case
303 arrange_windows(parent, -1, -1); 307 /* arrange_windows(parent, -1, -1); */
304 arrange_windows(parent->parent, -1, -1); 308 arrange_windows(parent->parent, -1, -1);
305 set_focused_container_for(parent->parent, container); 309 set_focused_container_for(parent->parent, container);
306} 310}