diff options
Diffstat (limited to 'sway/tree/layout.c')
-rw-r--r-- | sway/tree/layout.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/sway/tree/layout.c b/sway/tree/layout.c index ab5acc16..a0764a54 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c | |||
@@ -387,9 +387,11 @@ void container_move(struct sway_container *container, | |||
387 | // If moving a fullscreen view, only consider outputs | 387 | // If moving a fullscreen view, only consider outputs |
388 | if (container->is_fullscreen) { | 388 | if (container->is_fullscreen) { |
389 | current = container_parent(container, C_OUTPUT); | 389 | current = container_parent(container, C_OUTPUT); |
390 | } else if (container_is_fullscreen_or_child(container)) { | 390 | } else if (container_is_fullscreen_or_child(container) || |
391 | container_is_floating_or_child(container)) { | ||
391 | // If we've fullscreened a split container, only allow the child to move | 392 | // If we've fullscreened a split container, only allow the child to move |
392 | // around within the fullscreen parent. | 393 | // around within the fullscreen parent. |
394 | // Same with floating a split container. | ||
393 | struct sway_container *ws = container_parent(container, C_WORKSPACE); | 395 | struct sway_container *ws = container_parent(container, C_WORKSPACE); |
394 | top = ws->sway_workspace->fullscreen; | 396 | top = ws->sway_workspace->fullscreen; |
395 | } | 397 | } |
@@ -465,6 +467,9 @@ void container_move(struct sway_container *container, | |||
465 | if ((index == parent->children->length - 1 && offs > 0) | 467 | if ((index == parent->children->length - 1 && offs > 0) |
466 | || (index == 0 && offs < 0)) { | 468 | || (index == 0 && offs < 0)) { |
467 | if (current->parent == container->parent) { | 469 | if (current->parent == container->parent) { |
470 | if (parent->parent->layout == L_FLOATING) { | ||
471 | return; | ||
472 | } | ||
468 | if (!parent->is_fullscreen && | 473 | if (!parent->is_fullscreen && |
469 | (parent->layout == L_TABBED || | 474 | (parent->layout == L_TABBED || |
470 | parent->layout == L_STACKED)) { | 475 | parent->layout == L_STACKED)) { |
@@ -488,10 +493,14 @@ void container_move(struct sway_container *container, | |||
488 | sibling = parent->children->items[index + offs]; | 493 | sibling = parent->children->items[index + offs]; |
489 | wlr_log(WLR_DEBUG, "Selecting sibling id:%zd", sibling->id); | 494 | wlr_log(WLR_DEBUG, "Selecting sibling id:%zd", sibling->id); |
490 | } | 495 | } |
491 | } else if (!parent->is_fullscreen && (parent->layout == L_TABBED || | 496 | } else if (!parent->is_fullscreen && |
497 | parent->parent->layout != L_FLOATING && | ||
498 | (parent->layout == L_TABBED || | ||
492 | parent->layout == L_STACKED)) { | 499 | parent->layout == L_STACKED)) { |
493 | move_out_of_tabs_stacks(container, current, move_dir, offs); | 500 | move_out_of_tabs_stacks(container, current, move_dir, offs); |
494 | return; | 501 | return; |
502 | } else if (parent->parent->layout == L_FLOATING) { | ||
503 | return; | ||
495 | } else { | 504 | } else { |
496 | wlr_log(WLR_DEBUG, "Moving up to find a parallel container"); | 505 | wlr_log(WLR_DEBUG, "Moving up to find a parallel container"); |
497 | current = current->parent; | 506 | current = current->parent; |
@@ -717,10 +726,6 @@ struct sway_container *container_get_in_direction( | |||
717 | enum movement_direction dir) { | 726 | enum movement_direction dir) { |
718 | struct sway_container *parent = container->parent; | 727 | struct sway_container *parent = container->parent; |
719 | 728 | ||
720 | if (container_is_floating(container)) { | ||
721 | return NULL; | ||
722 | } | ||
723 | |||
724 | if (dir == MOVE_CHILD) { | 729 | if (dir == MOVE_CHILD) { |
725 | return seat_get_focus_inactive(seat, container); | 730 | return seat_get_focus_inactive(seat, container); |
726 | } | 731 | } |
@@ -732,7 +737,7 @@ struct sway_container *container_get_in_direction( | |||
732 | parent = container->parent; | 737 | parent = container->parent; |
733 | } else { | 738 | } else { |
734 | if (dir == MOVE_PARENT) { | 739 | if (dir == MOVE_PARENT) { |
735 | if (parent->type == C_OUTPUT) { | 740 | if (parent->type == C_OUTPUT || container_is_floating(container)) { |
736 | return NULL; | 741 | return NULL; |
737 | } else { | 742 | } else { |
738 | return parent; | 743 | return parent; |