It looks like the function only works if xdg_surface->role == TOPLEVEL, so I included a skip for WLR_XDG_SURFACE_ROLE_NONE

This commit is contained in:
Palanix 2021-10-13 22:06:30 +02:00
parent eb1ddd782b
commit e6d06ed14b

5
dwl.c
View File

@ -882,7 +882,7 @@ 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) {
Client *sel = selclient();
struct wlr_box pop_box = {
.x = sel->geom.x - selmon->m.x,
@ -894,6 +894,9 @@ createnotify(struct wl_listener *listener, void *data)
return;
}
if (xdg_surface->role != WLR_XDG_SURFACE_ROLE_TOPLEVEL)
return;
/* Allocate a Client for this surface */
c = xdg_surface->data = calloc(1, sizeof(*c));
c->surface.xdg = xdg_surface;