Use wlr_output_layout_get_box

This commit is contained in:
emersion 2017-12-06 19:23:43 +01:00
parent 7c5d8c553c
commit 41dd291612
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48

View file

@ -26,27 +26,10 @@ void swayc_descendants_of_type(swayc_t *root, enum swayc_types type,
} }
static void update_root_geometry() { static void update_root_geometry() {
int width = 0; struct wlr_box *box =
int height = 0; wlr_output_layout_get_box(root_container.output_layout, NULL);
swayc_t *child; root_container.width = box->width;
int child_width; root_container.height = box->height;
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;
} }
static swayc_t *new_swayc(enum swayc_types type) { static swayc_t *new_swayc(enum swayc_types type) {