diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-09-01 08:02:05 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-09-05 18:01:43 +1000 |
commit | 7f40b928c7ec5cb6e1296f7527392731ca2aa84a (patch) | |
tree | 8e26eeb29de253d30c2ec403eb581369ce61344c /sway/commands | |
parent | fb9b0f7a08e472aa99f7f2ac446815f649f33300 (diff) | |
download | sway-7f40b928c7ec5cb6e1296f7527392731ca2aa84a.tar.xz |
Fix another focus bug when moving into output
Find the focused_inactive view rather than possibly selecting a parent.
Diffstat (limited to 'sway/commands')
-rw-r--r-- | sway/commands/focus.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sway/commands/focus.c b/sway/commands/focus.c index 30cfa1c5..e48e48aa 100644 --- a/sway/commands/focus.c +++ b/sway/commands/focus.c @@ -54,7 +54,7 @@ static struct sway_node *get_node_in_output_direction( } else { container = seat_get_focus_inactive_tiling(seat, ws); } - return &container->node; + break; case MOVE_RIGHT: if (ws->layout == L_HORIZ || ws->layout == L_TABBED) { // get most left child of new output @@ -62,7 +62,7 @@ static struct sway_node *get_node_in_output_direction( } else { container = seat_get_focus_inactive_tiling(seat, ws); } - return &container->node; + break; case MOVE_UP: if (ws->layout == L_VERT || ws->layout == L_STACKED) { // get most bottom child of new output @@ -70,7 +70,7 @@ static struct sway_node *get_node_in_output_direction( } else { container = seat_get_focus_inactive_tiling(seat, ws); } - return &container->node; + break; case MOVE_DOWN: { if (ws->layout == L_VERT || ws->layout == L_STACKED) { // get most top child of new output @@ -78,13 +78,18 @@ static struct sway_node *get_node_in_output_direction( } else { container = seat_get_focus_inactive_tiling(seat, ws); } - return &container->node; + break; } default: break; } } + if (container) { + container = seat_get_focus_inactive_view(seat, &container->node); + return &container->node; + } + return &ws->node; } |