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

@ -73,6 +73,12 @@ static void
handle_destroy(struct wl_listener *listener, void *data)
{
struct xdg_popup *popup = wl_container_of(listener, popup, destroy);
struct wlr_xdg_popup *_popup, *tmp;
wl_list_for_each_safe(_popup, tmp, &popup->wlr_popup->base->popups, link) {
wlr_xdg_popup_destroy(_popup);
}
wl_list_remove(&popup->destroy.link);
wl_list_remove(&popup->new_popup.link);
wl_list_remove(&popup->reposition.link);