fix popups appearing outside the monitor

and a potentially crash
This commit is contained in:
Leonardo Hernández Hernández 2022-12-06 13:31:48 -06:00
parent c9a0a8bf6d
commit 19b5d47a9e
Failed to generate hash of commit

2
dwl.c
View file

@ -914,7 +914,7 @@ createnotify(struct wl_listener *listener, void *data)
return; return;
xdg_surface->surface->data = wlr_scene_xdg_surface_create( xdg_surface->surface->data = wlr_scene_xdg_surface_create(
xdg_surface->popup->parent->data, xdg_surface); xdg_surface->popup->parent->data, xdg_surface);
if ((!l || !l->mon) || (!c || !c->mon)) if ((l && !l->mon) || (c && !c->mon))
return; return;
box = type == LayerShell ? l->mon->m : c->mon->w; box = type == LayerShell ? l->mon->m : c->mon->w;
box.x -= (type == LayerShell ? l->geom.x : c->geom.x); box.x -= (type == LayerShell ? l->geom.x : c->geom.x);