Fix another focus bug when moving into output

Find the focused_inactive view rather than possibly selecting a parent.
This commit is contained in:
Ryan Dwyer 2018-09-01 08:02:05 +10:00
parent fb9b0f7a08
commit 7f40b928c7

View file

@ -54,7 +54,7 @@ static struct sway_node *get_node_in_output_direction(
} else { } else {
container = seat_get_focus_inactive_tiling(seat, ws); container = seat_get_focus_inactive_tiling(seat, ws);
} }
return &container->node; break;
case MOVE_RIGHT: case MOVE_RIGHT:
if (ws->layout == L_HORIZ || ws->layout == L_TABBED) { if (ws->layout == L_HORIZ || ws->layout == L_TABBED) {
// get most left child of new output // get most left child of new output
@ -62,7 +62,7 @@ static struct sway_node *get_node_in_output_direction(
} else { } else {
container = seat_get_focus_inactive_tiling(seat, ws); container = seat_get_focus_inactive_tiling(seat, ws);
} }
return &container->node; break;
case MOVE_UP: case MOVE_UP:
if (ws->layout == L_VERT || ws->layout == L_STACKED) { if (ws->layout == L_VERT || ws->layout == L_STACKED) {
// get most bottom child of new output // get most bottom child of new output
@ -70,7 +70,7 @@ static struct sway_node *get_node_in_output_direction(
} else { } else {
container = seat_get_focus_inactive_tiling(seat, ws); container = seat_get_focus_inactive_tiling(seat, ws);
} }
return &container->node; break;
case MOVE_DOWN: { case MOVE_DOWN: {
if (ws->layout == L_VERT || ws->layout == L_STACKED) { if (ws->layout == L_VERT || ws->layout == L_STACKED) {
// get most top child of new output // get most top child of new output
@ -78,13 +78,18 @@ static struct sway_node *get_node_in_output_direction(
} else { } else {
container = seat_get_focus_inactive_tiling(seat, ws); container = seat_get_focus_inactive_tiling(seat, ws);
} }
return &container->node; break;
} }
default: default:
break; break;
} }
} }
if (container) {
container = seat_get_focus_inactive_view(seat, &container->node);
return &container->node;
}
return &ws->node; return &ws->node;
} }