From 3f4c0aff134c79daff8ac57284784b777ca68547 Mon Sep 17 00:00:00 2001 From: ShootingStarDragons Date: Sat, 17 Feb 2024 22:09:45 +0800 Subject: [PATCH] chore: apply the destory scene way suggested --- sway/input/text_input.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sway/input/text_input.c b/sway/input/text_input.c index a2ab21db4..e6b321131 100644 --- a/sway/input/text_input.c +++ b/sway/input/text_input.c @@ -276,9 +276,17 @@ static void input_popup_update(struct sway_input_popup *popup) { return; } - if (!popup->popup_surface->surface->mapped) { + if (popup->scene_tree != NULL) { + wlr_scene_node_destroy(&popup->scene_tree->node); popup->scene_tree = NULL; - popup->desc.view = NULL; + } + if (popup->desc.relative != NULL) { + wlr_scene_node_destroy(popup->desc.relative); + popup->desc.relative = NULL; + } + popup->desc.view = NULL; + + if (!popup->popup_surface->surface->mapped) { return; }