diff options
author | emersion <contact@emersion.fr> | 2017-12-06 19:23:43 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2017-12-06 19:23:43 +0100 |
commit | 41dd29161249dd6b6c3288a2d4cf63763f40ce14 (patch) | |
tree | b01a5961680717b22d12e36748a7a1b09509f99a | |
parent | Simplify free calls, use wlr_output_set_scale (diff) | |
download | sway-41dd29161249dd6b6c3288a2d4cf63763f40ce14.tar.gz sway-41dd29161249dd6b6c3288a2d4cf63763f40ce14.tar.zst sway-41dd29161249dd6b6c3288a2d4cf63763f40ce14.zip |
Use wlr_output_layout_get_box
-rw-r--r-- | sway/tree/container.c | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index ba305efa..ec3311a0 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c | |||
@@ -26,27 +26,10 @@ void swayc_descendants_of_type(swayc_t *root, enum swayc_types type, | |||
26 | } | 26 | } |
27 | 27 | ||
28 | static void update_root_geometry() { | 28 | static void update_root_geometry() { |
29 | int width = 0; | 29 | struct wlr_box *box = |
30 | int height = 0; | 30 | wlr_output_layout_get_box(root_container.output_layout, NULL); |
31 | swayc_t *child; | 31 | root_container.width = box->width; |
32 | int child_width; | 32 | root_container.height = box->height; |
33 | int child_height; | ||
34 | |||
35 | for (int i = 0; i < root_container.children->length; ++i) { | ||
36 | child = root_container.children->items[i]; | ||
37 | child_width = child->width + child->x; | ||
38 | child_height = child->height + child->y; | ||
39 | if (child_width > width) { | ||
40 | width = child_width; | ||
41 | } | ||
42 | |||
43 | if (child_height > height) { | ||
44 | height = child_height; | ||
45 | } | ||
46 | } | ||
47 | |||
48 | root_container.width = width; | ||
49 | root_container.height = height; | ||
50 | } | 33 | } |
51 | 34 | ||
52 | static swayc_t *new_swayc(enum swayc_types type) { | 35 | static swayc_t *new_swayc(enum swayc_types type) { |