diff options
author | 2018-03-29 23:15:39 -0400 | |
---|---|---|
committer | 2018-03-29 23:15:39 -0400 | |
commit | 2778edef976a669dd0019ebb5327bcfeb4de13c5 (patch) | |
tree | 6d9c1cecaa845590025f8354047e2986c3301092 /sway/tree/layout.c | |
parent | rename container_for_each_descendent (diff) | |
download | sway-2778edef976a669dd0019ebb5327bcfeb4de13c5.tar.gz sway-2778edef976a669dd0019ebb5327bcfeb4de13c5.tar.zst sway-2778edef976a669dd0019ebb5327bcfeb4de13c5.zip |
arrange windows
Diffstat (limited to 'sway/tree/layout.c')
-rw-r--r-- | sway/tree/layout.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sway/tree/layout.c b/sway/tree/layout.c index 614d0505..dc0ee5b4 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c | |||
@@ -42,7 +42,7 @@ static void output_layout_change_notify(struct wl_listener *listener, | |||
42 | output_container->height = output_box->height; | 42 | output_container->height = output_box->height; |
43 | } | 43 | } |
44 | 44 | ||
45 | container_arrange_windows(&root_container, -1, -1); | 45 | arrange_windows(&root_container, -1, -1); |
46 | } | 46 | } |
47 | 47 | ||
48 | void layout_init(void) { | 48 | void layout_init(void) { |
@@ -167,7 +167,7 @@ static void apply_vert_layout(struct sway_container *container, const double x, | |||
167 | const double height, const int start, | 167 | const double height, const int start, |
168 | const int end); | 168 | const int end); |
169 | 169 | ||
170 | void container_arrange_windows(struct sway_container *container, | 170 | void arrange_windows(struct sway_container *container, |
171 | double width, double height) { | 171 | double width, double height) { |
172 | int i; | 172 | int i; |
173 | if (width == -1 || height == -1) { | 173 | if (width == -1 || height == -1) { |
@@ -192,7 +192,7 @@ void container_arrange_windows(struct sway_container *container, | |||
192 | struct sway_container *output = container->children->items[i]; | 192 | struct sway_container *output = container->children->items[i]; |
193 | wlr_log(L_DEBUG, "Arranging output '%s' at %f,%f", | 193 | wlr_log(L_DEBUG, "Arranging output '%s' at %f,%f", |
194 | output->name, output->x, output->y); | 194 | output->name, output->x, output->y); |
195 | container_arrange_windows(output, -1, -1); | 195 | arrange_windows(output, -1, -1); |
196 | } | 196 | } |
197 | return; | 197 | return; |
198 | case C_OUTPUT: | 198 | case C_OUTPUT: |
@@ -206,7 +206,7 @@ void container_arrange_windows(struct sway_container *container, | |||
206 | // arrange all workspaces: | 206 | // arrange all workspaces: |
207 | for (i = 0; i < container->children->length; ++i) { | 207 | for (i = 0; i < container->children->length; ++i) { |
208 | struct sway_container *child = container->children->items[i]; | 208 | struct sway_container *child = container->children->items[i]; |
209 | container_arrange_windows(child, -1, -1); | 209 | arrange_windows(child, -1, -1); |
210 | } | 210 | } |
211 | return; | 211 | return; |
212 | case C_WORKSPACE: | 212 | case C_WORKSPACE: |
@@ -294,9 +294,9 @@ static void apply_horiz_layout(struct sway_container *container, | |||
294 | 294 | ||
295 | if (i == end - 1) { | 295 | if (i == end - 1) { |
296 | double remaining_width = x + width - child_x; | 296 | double remaining_width = x + width - child_x; |
297 | container_arrange_windows(child, remaining_width, height); | 297 | arrange_windows(child, remaining_width, height); |
298 | } else { | 298 | } else { |
299 | container_arrange_windows(child, child->width * scale, height); | 299 | arrange_windows(child, child->width * scale, height); |
300 | } | 300 | } |
301 | child_x += child->width; | 301 | child_x += child->width; |
302 | } | 302 | } |
@@ -345,9 +345,9 @@ void apply_vert_layout(struct sway_container *container, | |||
345 | 345 | ||
346 | if (i == end - 1) { | 346 | if (i == end - 1) { |
347 | double remaining_height = y + height - child_y; | 347 | double remaining_height = y + height - child_y; |
348 | container_arrange_windows(child, width, remaining_height); | 348 | arrange_windows(child, width, remaining_height); |
349 | } else { | 349 | } else { |
350 | container_arrange_windows(child, width, child->height * scale); | 350 | arrange_windows(child, width, child->height * scale); |
351 | } | 351 | } |
352 | child_y += child->height; | 352 | child_y += child->height; |
353 | } | 353 | } |