diff options
-rw-r--r-- | sway/tree/layout.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/sway/tree/layout.c b/sway/tree/layout.c index edc24deb..6763b34c 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c | |||
@@ -586,11 +586,19 @@ static struct sway_container *get_swayc_in_output_direction( | |||
586 | if (ws->children->length > 0) { | 586 | if (ws->children->length > 0) { |
587 | switch (dir) { | 587 | switch (dir) { |
588 | case MOVE_LEFT: | 588 | case MOVE_LEFT: |
589 | // get most right child of new output | 589 | if (ws->layout == L_HORIZ || ws->layout == L_TABBED) { |
590 | return ws->children->items[ws->children->length-1]; | 590 | // get most right child of new output |
591 | return ws->children->items[ws->children->length-1]; | ||
592 | } else { | ||
593 | return seat_get_focus_inactive(seat, ws); | ||
594 | } | ||
591 | case MOVE_RIGHT: | 595 | case MOVE_RIGHT: |
592 | // get most left child of new output | 596 | if (ws->layout == L_HORIZ || ws->layout == L_TABBED) { |
593 | return ws->children->items[0]; | 597 | // get most left child of new output |
598 | return ws->children->items[0]; | ||
599 | } else { | ||
600 | return seat_get_focus_inactive(seat, ws); | ||
601 | } | ||
594 | case MOVE_UP: | 602 | case MOVE_UP: |
595 | case MOVE_DOWN: { | 603 | case MOVE_DOWN: { |
596 | struct sway_container *focused = | 604 | struct sway_container *focused = |