Destroy xdg_popups when its parent is destroyed

Fixes: #2845
This commit is contained in:
Consolatis 2025-06-18 17:40:04 +02:00 committed by Johan Malm
parent a8df2487b2
commit 30248e1ba3
4 changed files with 35 additions and 0 deletions

View file

@ -345,6 +345,11 @@ handle_destroy(struct wl_listener *listener, void *data)
struct xdg_toplevel_view *xdg_toplevel_view =
xdg_toplevel_view_from_view(view);
struct wlr_xdg_popup *popup, *tmp;
wl_list_for_each_safe(popup, tmp, &xdg_toplevel_view->xdg_surface->popups, link) {
wlr_xdg_popup_destroy(popup);
}
xdg_toplevel_view->xdg_surface->data = NULL;
xdg_toplevel_view->xdg_surface = NULL;