summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonardo Hernandez Hernandez <leohdz172@protonmail.com>2021-10-29 18:38:24 -0500
committerLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-03-16 08:48:41 -0600
commit1087bc5db98faf12e02e57433ed52cbc9845e98b (patch)
tree57ecbeda6d5629ae142633ec84cbdd36afe53e4b
parent4465dcb6da1fb91177fc26b4513d14c48eb56d5e (diff)
use wlr_scene_xdg_surface_create() for xdg_popups
-rw-r--r--dwl.c9
1 files 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);