foreign: set parent

Tested with wlroots/examples/foreign-toplevel.c

Helped-by: @Consolatis
This commit is contained in:
Johan Malm 2023-08-03 21:32:58 +01:00 committed by Consolatis
parent 2b9a6914a6
commit b149526d03
2 changed files with 36 additions and 2 deletions

View file

@ -407,6 +407,22 @@ top_left_edge_boundary_check(struct view *view)
view->impl->configure(view, view->current);
}
static void
init_foreign_toplevel(struct view *view)
{
foreign_toplevel_handle_create(view);
struct wlr_xwayland_surface *surface = xwayland_surface_from_view(view);
if (!surface->parent) {
return;
}
struct view *parent = (struct view *)surface->parent->data;
if (!parent->toplevel.handle) {
return;
}
wlr_foreign_toplevel_handle_v1_set_parent(view->toplevel.handle, parent->toplevel.handle);
}
static void
xwayland_view_map(struct view *view)
{
@ -453,7 +469,7 @@ xwayland_view_map(struct view *view)
}
if (!view->toplevel.handle) {
foreign_toplevel_handle_create(view);
init_foreign_toplevel(view);
}
if (!view->been_mapped) {