diff options
Diffstat (limited to 'sway/commands/resize.c')
-rw-r--r-- | sway/commands/resize.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sway/commands/resize.c b/sway/commands/resize.c index f6141afc..6cdeb90c 100644 --- a/sway/commands/resize.c +++ b/sway/commands/resize.c | |||
@@ -173,8 +173,17 @@ void container_resize_tiled(struct sway_container *con, | |||
173 | int index = container_sibling_index(con); | 173 | int index = container_sibling_index(con); |
174 | 174 | ||
175 | if (axis == AXIS_HORIZONTAL || axis == AXIS_VERTICAL) { | 175 | if (axis == AXIS_HORIZONTAL || axis == AXIS_VERTICAL) { |
176 | prev = siblings->items[index - 1]; | 176 | if (index == 0) { |
177 | next = siblings->items[index + 1]; | 177 | next = siblings->items[1]; |
178 | } else if (index == siblings->length - 1) { | ||
179 | // Convert edge to top/left | ||
180 | next = con; | ||
181 | con = siblings->items[index - 1]; | ||
182 | amount = -amount; | ||
183 | } else { | ||
184 | prev = siblings->items[index - 1]; | ||
185 | next = siblings->items[index + 1]; | ||
186 | } | ||
178 | } else if (axis == WLR_EDGE_TOP || axis == WLR_EDGE_LEFT) { | 187 | } else if (axis == WLR_EDGE_TOP || axis == WLR_EDGE_LEFT) { |
179 | if (!sway_assert(index > 0, "Didn't expect first child")) { | 188 | if (!sway_assert(index > 0, "Didn't expect first child")) { |
180 | return; | 189 | return; |