diff options
Diffstat (limited to 'sway/tree/layout.c')
-rw-r--r-- | sway/tree/layout.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/sway/tree/layout.c b/sway/tree/layout.c index aca9e254..1507eba9 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c @@ -708,7 +708,10 @@ struct sway_container *container_get_in_direction( sway_output_from_wlr(wlr_adjacent); if (!adjacent || adjacent == container) { - return wrap_candidate; + if (!wrap_candidate) { + return NULL; + } + return seat_get_focus_inactive_view(seat, wrap_candidate); } struct sway_container *next = get_swayc_in_output_direction(adjacent, dir, seat); @@ -748,23 +751,25 @@ struct sway_container *container_get_in_direction( if (desired < 0 || desired >= parent->children->length) { can_move = false; int len = parent->children->length; - if (!wrap_candidate && len > 1) { + if (config->focus_wrapping != WRAP_NO && !wrap_candidate + && len > 1) { if (desired < 0) { wrap_candidate = parent->children->items[len-1]; } else { wrap_candidate = parent->children->items[0]; } - if (config->force_focus_wrapping) { - return wrap_candidate; + if (config->focus_wrapping == WRAP_FORCE) { + return seat_get_focus_inactive_view(seat, + wrap_candidate); } } } else { - struct sway_container *desired_con = parent->children->items[desired]; + struct sway_container *desired_con = + parent->children->items[desired]; wlr_log(L_DEBUG, "cont %d-%p dir %i sibling %d: %p", idx, container, dir, desired, desired_con); - struct sway_container *next = seat_get_focus_inactive_view(seat, desired_con); - return next; + return seat_get_focus_inactive_view(seat, desired_con); } } @@ -773,7 +778,10 @@ struct sway_container *container_get_in_direction( parent = parent->parent; if (!parent) { // wrapping is the last chance - return wrap_candidate; + if (!wrap_candidate) { + return NULL; + } + return seat_get_focus_inactive_view(seat, wrap_candidate); } } } |