diff options
author | Tony Crisci <tony@dubstepdish.com> | 2018-03-29 23:15:39 -0400 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2018-03-29 23:15:39 -0400 |
commit | 2778edef976a669dd0019ebb5327bcfeb4de13c5 (patch) | |
tree | 6d9c1cecaa845590025f8354047e2986c3301092 /sway/tree | |
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')
-rw-r--r-- | sway/tree/container.c | 2 | ||||
-rw-r--r-- | sway/tree/layout.c | 16 | ||||
-rw-r--r-- | sway/tree/workspace.c | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index fe97d645..40047dcf 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c | |||
@@ -221,7 +221,7 @@ struct sway_container *container_output_destroy(struct sway_container *output) { | |||
221 | container_add_child(root_container.children->items[p], child); | 221 | container_add_child(root_container.children->items[p], child); |
222 | } | 222 | } |
223 | container_sort_workspaces(root_container.children->items[p]); | 223 | container_sort_workspaces(root_container.children->items[p]); |
224 | container_arrange_windows(root_container.children->items[p], | 224 | arrange_windows(root_container.children->items[p], |
225 | -1, -1); | 225 | -1, -1); |
226 | } | 226 | } |
227 | } | 227 | } |
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 | } |
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c index 369cf14c..ba04c55c 100644 --- a/sway/tree/workspace.c +++ b/sway/tree/workspace.c | |||
@@ -247,6 +247,6 @@ bool workspace_switch(struct sway_container *workspace) { | |||
247 | } | 247 | } |
248 | sway_seat_set_focus(seat, next); | 248 | sway_seat_set_focus(seat, next); |
249 | struct sway_container *output = container_parent(workspace, C_OUTPUT); | 249 | struct sway_container *output = container_parent(workspace, C_OUTPUT); |
250 | container_arrange_windows(output, -1, -1); | 250 | arrange_windows(output, -1, -1); |
251 | return true; | 251 | return true; |
252 | } | 252 | } |