diff options
author | 2016-10-07 07:42:51 +0200 | |
---|---|---|
committer | 2016-10-07 09:37:09 +0200 | |
commit | 379b1a0378292ff1c470276f1caad59f36c7fc66 (patch) | |
tree | c7c6ddb5f329e003b218989c05fe784a632d341d /sway | |
parent | add force_focus_wrapping option (diff) | |
download | sway-379b1a0378292ff1c470276f1caad59f36c7fc66.tar.gz sway-379b1a0378292ff1c470276f1caad59f36c7fc66.tar.zst sway-379b1a0378292ff1c470276f1caad59f36c7fc66.zip |
add focus changing between floating containers
It will also wrap if needed.
Diffstat (limited to 'sway')
-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 | |||
1113 | if (can_move) { | 1113 | if (can_move) { |
1114 | int desired = index_child(container) + diff; | 1114 | int desired = index_child(container) + diff; |
1115 | if (container->is_floating) { | 1115 | if (container->is_floating) { |
1116 | can_move = false; | 1116 | if (desired < 0) { |
1117 | wrap_candidate = parent->floating->items[parent->floating->length-1]; | ||
1118 | } else if (desired >= parent->floating->length){ | ||
1119 | wrap_candidate = parent->floating->items[0]; | ||
1120 | } else { | ||
1121 | wrap_candidate = parent->floating->items[desired]; | ||
1122 | } | ||
1123 | if (wrap_candidate) { | ||
1124 | wlc_view_bring_to_front(wrap_candidate->handle); | ||
1125 | } | ||
1126 | return wrap_candidate; | ||
1117 | } else if (desired < 0 || desired >= parent->children->length) { | 1127 | } else if (desired < 0 || desired >= parent->children->length) { |
1118 | can_move = false; | 1128 | can_move = false; |
1119 | int len = parent->children->length; | 1129 | int len = parent->children->length; |