Port 0.16 wlr_output_layout_get_box changes

Fixes memory leaks.
This commit is contained in:
Alexander Orzechowski 2022-10-12 04:05:33 -04:00 committed by Jente Hidskes Ankarberg
parent 5818a32a99
commit 979ff58a24
3 changed files with 17 additions and 13 deletions

9
view.c
View file

@ -88,12 +88,13 @@ view_center(struct cg_view *view, struct wlr_box *layout_box)
void
view_position(struct cg_view *view)
{
struct wlr_box *layout_box = wlr_output_layout_get_box(view->server->output_layout, NULL);
struct wlr_box layout_box;
wlr_output_layout_get_box(view->server->output_layout, NULL, &layout_box);
if (view_is_primary(view) || view_extends_output_layout(view, layout_box)) {
view_maximize(view, layout_box);
if (view_is_primary(view) || view_extends_output_layout(view, &layout_box)) {
view_maximize(view, &layout_box);
} else {
view_center(view, layout_box);
view_center(view, &layout_box);
}
}