Merge pull request #2035 from RyanDwyer/fix-focus-bug

Fix focus bug when moving between outputs
This commit is contained in:
Drew DeVault 2018-05-25 08:40:00 -04:00 committed by GitHub
commit 95cc84bd95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -586,11 +586,19 @@ static struct sway_container *get_swayc_in_output_direction(
if (ws->children->length > 0) { if (ws->children->length > 0) {
switch (dir) { switch (dir) {
case MOVE_LEFT: case MOVE_LEFT:
// get most right child of new output if (ws->layout == L_HORIZ || ws->layout == L_TABBED) {
return ws->children->items[ws->children->length-1]; // get most right child of new output
return ws->children->items[ws->children->length-1];
} else {
return seat_get_focus_inactive(seat, ws);
}
case MOVE_RIGHT: case MOVE_RIGHT:
// get most left child of new output if (ws->layout == L_HORIZ || ws->layout == L_TABBED) {
return ws->children->items[0]; // get most left child of new output
return ws->children->items[0];
} else {
return seat_get_focus_inactive(seat, ws);
}
case MOVE_UP: case MOVE_UP:
case MOVE_DOWN: { case MOVE_DOWN: {
struct sway_container *focused = struct sway_container *focused =