commit 95cc84bd950f7c057a15f65d477462b5cc9527d2 parent 3c77f066a532efd3df0f2072d02fa4353b4a4511 Author: Drew DeVault <sir@cmpwn.com> Date: Fri, 25 May 2018 08:40:00 -0400 Merge pull request #2035 from RyanDwyer/fix-focus-bug Fix focus bug when moving between outputs Diffstat:
| M | sway/tree/layout.c | | | 16 | ++++++++++++---- |
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/sway/tree/layout.c b/sway/tree/layout.c @@ -586,11 +586,19 @@ static struct sway_container *get_swayc_in_output_direction( if (ws->children->length > 0) { switch (dir) { case MOVE_LEFT: - // get most right child of new output - return ws->children->items[ws->children->length-1]; + if (ws->layout == L_HORIZ || ws->layout == L_TABBED) { + // 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: - // get most left child of new output - return ws->children->items[0]; + if (ws->layout == L_HORIZ || ws->layout == L_TABBED) { + // 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_DOWN: { struct sway_container *focused =