xdg_shell: configure surface on initial commit

Instead of waiting for the surface to be mapped before sending a
configure event, do it on initial commit.

Note, wlroots 0.18 no longer sends automatic configure events on
initial commit.
This commit is contained in:
Simon Ser 2024-08-24 15:44:46 +02:00
parent 8b0b69c113
commit ca4b8c065b
3 changed files with 24 additions and 2 deletions

8
view.c
View file

@ -67,7 +67,9 @@ view_maximize(struct cg_view *view, struct wlr_box *layout_box)
view->lx = layout_box->x;
view->ly = layout_box->y;
wlr_scene_node_set_position(&view->scene_tree->node, view->lx, view->ly);
if (view->scene_tree) {
wlr_scene_node_set_position(&view->scene_tree->node, view->lx, view->ly);
}
view->impl->maximize(view, layout_box->width, layout_box->height);
}
@ -81,7 +83,9 @@ view_center(struct cg_view *view, struct wlr_box *layout_box)
view->lx = (layout_box->width - width) / 2;
view->ly = (layout_box->height - height) / 2;
wlr_scene_node_set_position(&view->scene_tree->node, view->lx, view->ly);
if (view->scene_tree) {
wlr_scene_node_set_position(&view->scene_tree->node, view->lx, view->ly);
}
}
void