From a0507a888600dc9188db5447ef36580a426c0b8e Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Wed, 25 Feb 2026 11:31:23 +0800 Subject: [PATCH] opt: destroy invalid popup of the client --- src/mango.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mango.c b/src/mango.c index add9fe87..c8288d05 100644 --- a/src/mango.c +++ b/src/mango.c @@ -2608,8 +2608,10 @@ static void commitpopup(struct wl_listener *listener, void *data) { goto commitpopup_listen_free; 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; + } wlr_scene_node_raise_to_top(wkr_popup->parent->data);