diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-05-25 08:40:00 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-25 08:40:00 -0400 |
commit | 95cc84bd950f7c057a15f65d477462b5cc9527d2 (patch) | |
tree | cf281ddfcafd731d7ea63cf80d2723deef8b4f77 | |
parent | Merge pull request #2028 from RyanDwyer/fix-move-workspace (diff) | |
parent | Fix focus bug when moving between outputs (diff) | |
download | sway-95cc84bd950f7c057a15f65d477462b5cc9527d2.tar.gz sway-95cc84bd950f7c057a15f65d477462b5cc9527d2.tar.zst sway-95cc84bd950f7c057a15f65d477462b5cc9527d2.zip |
Merge pull request #2035 from RyanDwyer/fix-focus-bug
Fix focus bug when moving between outputs
-rw-r--r-- | sway/tree/layout.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/sway/tree/layout.c b/sway/tree/layout.c index 91759f7b..e32e0d7d 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c | |||
@@ -586,11 +586,19 @@ static struct sway_container *get_swayc_in_output_direction( | |||
586 | if (ws->children->length > 0) { | 586 | if (ws->children->length > 0) { |
587 | switch (dir) { | 587 | switch (dir) { |
588 | case MOVE_LEFT: | 588 | case MOVE_LEFT: |
589 | // get most right child of new output | 589 | if (ws->layout == L_HORIZ || ws->layout == L_TABBED) { |
590 | return ws->children->items[ws->children->length-1]; | 590 | // get most right child of new output |
591 | return ws->children->items[ws->children->length-1]; | ||
592 | } else { | ||
593 | return seat_get_focus_inactive(seat, ws); | ||
594 | } | ||
591 | case MOVE_RIGHT: | 595 | case MOVE_RIGHT: |
592 | // get most left child of new output | 596 | if (ws->layout == L_HORIZ || ws->layout == L_TABBED) { |
593 | return ws->children->items[0]; | 597 | // get most left child of new output |
598 | return ws->children->items[0]; | ||
599 | } else { | ||
600 | return seat_get_focus_inactive(seat, ws); | ||
601 | } | ||
594 | case MOVE_UP: | 602 | case MOVE_UP: |
595 | case MOVE_DOWN: { | 603 | case MOVE_DOWN: { |
596 | struct sway_container *focused = | 604 | struct sway_container *focused = |