From 61e198d7a142f1de8a5b982489b1ccfdfe433bdd Mon Sep 17 00:00:00 2001 From: Zuki Air Date: Tue, 5 Aug 2025 20:34:47 +0100 Subject: [PATCH] fix crashes with windows changing their title after unmapnotify is called --- dwl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dwl.c b/dwl.c index 78a763b..aab69f9 100644 --- a/dwl.c +++ b/dwl.c @@ -2884,8 +2884,9 @@ unmapnotify(struct wl_listener *listener, void *data) setmon(c, NULL, 0); wl_list_remove(&c->flink); } - if (c->ext_foreign_toplevel) { + if (c->ext_foreign_toplevel != NULL) { wlr_ext_foreign_toplevel_handle_v1_destroy(c->ext_foreign_toplevel); + c->ext_foreign_toplevel = NULL; } #ifdef XWAYLAND if (c->type != XDGShell && c->capture.image_capture_scene_surface) { @@ -3012,7 +3013,7 @@ updatetitle(struct wl_listener *listener, void *data) Client *c = wl_container_of(listener, c, set_title); if (c == focustop(c->mon)) printstatus(); - if (c->ext_foreign_toplevel) { + if (c->ext_foreign_toplevel != NULL) { struct wlr_ext_foreign_toplevel_handle_v1_state foreign_toplevel_state = { .app_id = client_get_appid(c), .title = client_get_title(c),