diff --git a/kiwmi/desktop/xdg_shell.c b/kiwmi/desktop/xdg_shell.c index 62bc41d..a4e4bfb 100644 --- a/kiwmi/desktop/xdg_shell.c +++ b/kiwmi/desktop/xdg_shell.c @@ -239,6 +239,10 @@ xdg_surface_destroy_notify(struct wl_listener *listener, void *UNUSED(data)) view_child_destroy(child); } + if (view->decoration) { + view->decoration->view = NULL; + } + wl_list_remove(&view->link); wl_list_remove(&view->children); wl_list_remove(&view->map.link); @@ -511,7 +515,9 @@ xdg_decoration_destroy_notify(struct wl_listener *listener, void *UNUSED(data)) struct kiwmi_xdg_decoration *decoration = wl_container_of(listener, decoration, destroy); - decoration->view->decoration = NULL; + if (decoration->view) { + decoration->view->decoration = NULL; + } wl_list_remove(&decoration->destroy.link); wl_list_remove(&decoration->request_mode.link);