diff options
author | D.B <thejan.2009@gmail.com> | 2016-10-07 07:42:51 +0200 |
---|---|---|
committer | D.B <thejan.2009@gmail.com> | 2016-10-07 09:37:09 +0200 |
commit | 379b1a0378292ff1c470276f1caad59f36c7fc66 (patch) | |
tree | c7c6ddb5f329e003b218989c05fe784a632d341d | |
parent | d3f5ac8cbbdde88e5822c1d9dd20ce9cbde8cbbe (diff) |
add focus changing between floating containers
It will also wrap if needed.
-rw-r--r-- | sway/layout.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sway/layout.c b/sway/layout.c index a7206e9a..3629df24 100644 --- a/sway/layout.c +++ b/sway/layout.c @@ -1113,7 +1113,17 @@ swayc_t *get_swayc_in_direction_under(swayc_t *container, enum movement_directio if (can_move) { int desired = index_child(container) + diff; if (container->is_floating) { - can_move = false; + if (desired < 0) { + wrap_candidate = parent->floating->items[parent->floating->length-1]; + } else if (desired >= parent->floating->length){ + wrap_candidate = parent->floating->items[0]; + } else { + wrap_candidate = parent->floating->items[desired]; + } + if (wrap_candidate) { + wlc_view_bring_to_front(wrap_candidate->handle); + } + return wrap_candidate; } else if (desired < 0 || desired >= parent->children->length) { can_move = false; int len = parent->children->length; |