use wlr_scene_xdg_surface_create() for xdg_popups

This commit is contained in:
Leonardo Hernandez Hernandez 2021-10-29 18:38:24 -05:00 committed by Leonardo Hernández Hernández
parent 4465dcb6da
commit 1087bc5db9
No known key found for this signature in database
GPG key ID: E538897EE11B9624

9
dwl.c
View file

@ -875,7 +875,11 @@ createnotify(struct wl_listener *listener, void *data)
struct wlr_xdg_surface *xdg_surface = data; struct wlr_xdg_surface *xdg_surface = data;
Client *c; 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; return;
/* Allocate a Client for this surface */ /* 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 */ /* Create scene tree for this client and its border */
c->scene = &wlr_scene_tree_create(layers[LyrTile])->node; 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; c->scene_surface->data = c;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
c->border[i] = wlr_scene_rect_create(c->scene, 0, 0, bordercolor); c->border[i] = wlr_scene_rect_create(c->scene, 0, 0, bordercolor);