7RLLU52RCOT2MQY4CPZTCDIA3FXETNPAISE5F2I7CI7TZW2SZVHAC
7HPLEFGATGAYG3O7EEGZ4UL4UOFXIJUQAKF377ZJXL3L5LQV3VIAC
WMNBUD2PGH4XJP7UJNQXULQ475EIQUPEDPZOVU4AT2ALU3FHKFEQC
FXT4YHEK6Q56BYLNUJJJZC5ZG6AJ2KNXROZIJNXSTOWIRH3A6XDQC
7B74AT3BXYB7PVW4F6SGQNPMHOU5TEV5TZ54CG6VSQI46XSEKWXQC
PSWOY2CD6NWN6INAVZIYXLLSDQU5USAF3PATAL7FYRHEVHQ77XFQC
MJZ6RCUUOK7R2RMXPXMLRWBAEM6234D2IS7RGPHAE5UN2S64GLGAC
commitpopup(struct wl_listener *listener, void *data)
{
struct wlr_surface *surface = data;
struct wlr_xdg_popup *popup = wlr_xdg_popup_try_from_wlr_surface(surface);
LayerSurface *l = NULL;
Client *c = NULL;
struct wlr_box box;
int type = -1;
if (!popup->base->initial_commit)
return;
type = toplevel_from_wlr_surface(popup->base->surface, &c, &l);
if (!popup->parent || type < 0)
return;
popup->base->surface->data = wlr_scene_xdg_surface_create(
popup->parent->data, popup->base);
if ((l && !l->mon) || (c && !c->mon))
return;
box = type == LayerShell ? l->mon->m : c->mon->w;
box.x -= (type == LayerShell ? l->geom.x : c->geom.x);
box.y -= (type == LayerShell ? l->geom.y : c->geom.y);
wlr_xdg_popup_unconstrain_from_box(popup, &box);
wl_list_remove(&listener->link);
}
void
LayerSurface *l = NULL;
Client *c = NULL;
struct wlr_box box;
int type = toplevel_from_wlr_surface(popup->base->surface, &c, &l);
if (!popup->parent || type < 0)
return;
popup->base->surface->data = wlr_scene_xdg_surface_create(
popup->parent->data, popup->base);
if ((l && !l->mon) || (c && !c->mon))
return;
box = type == LayerShell ? l->mon->m : c->mon->w;
box.x -= (type == LayerShell ? l->geom.x : c->geom.x);
box.y -= (type == LayerShell ? l->geom.y : c->geom.y);
/* FIXME: this send a configure event to a uninitialized wlr_xdg_surface */
wlr_xdg_popup_unconstrain_from_box(popup, &box);
LISTEN_STATIC(&popup->base->surface->events.commit, commitpopup);