aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-12-06 19:23:43 +0100
committeremersion <contact@emersion.fr>2017-12-06 19:23:43 +0100
commit41dd29161249dd6b6c3288a2d4cf63763f40ce14 (patch)
treeb01a5961680717b22d12e36748a7a1b09509f99a
parent7c5d8c553cbf5e93538346c904f2c2e42af66c7c (diff)
Use wlr_output_layout_get_box
-rw-r--r--sway/tree/container.c25
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,
}
static void update_root_geometry() {
- int width = 0;
- int height = 0;
- swayc_t *child;
- int child_width;
- int child_height;
-
- for (int i = 0; i < root_container.children->length; ++i) {
- child = root_container.children->items[i];
- child_width = child->width + child->x;
- child_height = child->height + child->y;
- if (child_width > width) {
- width = child_width;
- }
-
- if (child_height > height) {
- height = child_height;
- }
- }
-
- root_container.width = width;
- root_container.height = height;
+ struct wlr_box *box =
+ wlr_output_layout_get_box(root_container.output_layout, NULL);
+ root_container.width = box->width;
+ root_container.height = box->height;
}
static swayc_t *new_swayc(enum swayc_types type) {