From 1087bc5db98faf12e02e57433ed52cbc9845e98b Mon Sep 17 00:00:00 2001 From: Leonardo Hernandez Hernandez Date: Fri, 29 Oct 2021 18:38:24 -0500 Subject: use wlr_scene_xdg_surface_create() for xdg_popups --- dwl.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dwl.c b/dwl.c index d2f910c..8deee97 100644 --- a/dwl.c +++ b/dwl.c @@ -875,7 +875,11 @@ createnotify(struct wl_listener *listener, void *data) struct wlr_xdg_surface *xdg_surface = data; Client *c; - if (xdg_surface->role != WLR_XDG_SURFACE_ROLE_TOPLEVEL) + if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP) { + xdg_surface->surface->data = wlr_scene_xdg_surface_create( + xdg_surface->popup->parent->data, xdg_surface); + return; + } else if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_NONE) return; /* Allocate a Client for this surface */ @@ -1311,7 +1315,8 @@ mapnotify(struct wl_listener *listener, void *data) /* Create scene tree for this client and its border */ c->scene = &wlr_scene_tree_create(layers[LyrTile])->node; - c->scene_surface = wlr_scene_subsurface_tree_create(c->scene, client_surface(c)); + c->scene_surface = client_surface(c)->data = + wlr_scene_subsurface_tree_create(c->scene, client_surface(c)); c->scene_surface->data = c; for (i = 0; i < 4; i++) { c->border[i] = wlr_scene_rect_create(c->scene, 0, 0, bordercolor); -- cgit v1.2.3