From a2bb0b3bf185e502058a47e52d4e0aed9f23a169 Mon Sep 17 00:00:00 2001 From: Palanix Date: Tue, 18 Jan 2022 17:46:02 +0100 Subject: [PATCH] Fix dwl crashing when a new client spawns, isn't viewed, and then a new Popup is spawned --- dwl.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dwl.c b/dwl.c index 34355d4..394812d 100644 --- a/dwl.c +++ b/dwl.c @@ -885,12 +885,15 @@ createnotify(struct wl_listener *listener, void *data) * client, either a toplevel (application window) or popup. */ struct wlr_xdg_surface *xdg_surface = data; Client *c; + Arg tags; + Arg oldtags; if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP) { Client *sel = selclient(); + Monitor *selmo = xytomon(cursor->x, cursor->y); struct wlr_box pop_box = { - .x = sel->geom.x - selmon->m.x, - .y = sel->geom.y - selmon->m.y, + .x = sel->geom.x - selmo->m.x, + .y = sel->geom.y - selmo->m.y, .width = sel->geom.width, .height = sel->geom.height, }; @@ -914,6 +917,10 @@ createnotify(struct wl_listener *listener, void *data) LISTEN(&xdg_surface->toplevel->events.request_fullscreen, &c->fullscreen, fullscreennotify); c->isfullscreen = 0; + oldtags.ui = c->tags; + tags.ui = c->tags; + view(&tags); + view(&oldtags); } void