From dd18b69098371a44ec4a85531a11ba3dedc194aa Mon Sep 17 00:00:00 2001 From: Palanix Date: Tue, 18 Jan 2022 21:19:17 +0100 Subject: [PATCH] Fix popups that are spawned by popups causing segfaults --- dwl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dwl.c b/dwl.c index 7735a0d..1e2f0de 100644 --- a/dwl.c +++ b/dwl.c @@ -887,12 +887,12 @@ createnotify(struct wl_listener *listener, void *data) Client *c; if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP) { - Client *c = wlr_xdg_surface_from_wlr_surface(xdg_surface->popup->parent)->data; + Monitor *selmon = xytomon(cursor->x, cursor->y); struct wlr_box pop_box = { .x = 0, .y = 0, - .width = c->geom.width, - .height = c->geom.height, + .width = selmon->m.width, + .height = selmon->m.height, }; wlr_xdg_popup_unconstrain_from_box(xdg_surface->popup, &pop_box); return;