opt: destroy invalid popup of the client

This commit is contained in:
DreamMaoMao 2026-02-25 11:31:23 +08:00
parent bb7b9caa09
commit a0507a8886

View file

@ -2608,8 +2608,10 @@ static void commitpopup(struct wl_listener *listener, void *data) {
goto commitpopup_listen_free; goto commitpopup_listen_free;
type = toplevel_from_wlr_surface(wkr_popup->base->surface, &c, &l); type = toplevel_from_wlr_surface(wkr_popup->base->surface, &c, &l);
if (!wkr_popup->parent || !wkr_popup->parent->data || type < 0) if (!wkr_popup->parent || !wkr_popup->parent->data || type < 0) {
wlr_xdg_popup_destroy(wkr_popup);
goto commitpopup_listen_free; goto commitpopup_listen_free;
}
wlr_scene_node_raise_to_top(wkr_popup->parent->data); wlr_scene_node_raise_to_top(wkr_popup->parent->data);