From b716e262cd6ddf53638105261b786ea32a9acc23 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Sun, 23 Jan 2022 20:37:37 +0100 Subject: [PATCH] XdgPopup: remove commit listener on destroy if mapped Since the destroy() function may be called by river while the popup is mapped, we must handle this case. --- river/XdgPopup.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/river/XdgPopup.zig b/river/XdgPopup.zig index 95e504b..e08f7b0 100644 --- a/river/XdgPopup.zig +++ b/river/XdgPopup.zig @@ -96,6 +96,8 @@ pub fn destroy(xdg_popup: *XdgPopup) void { xdg_popup.new_popup.link.remove(); xdg_popup.new_subsurface.link.remove(); + if (xdg_popup.wlr_xdg_popup.base.mapped) xdg_popup.commit.link.remove(); + Subsurface.destroySubsurfaces(xdg_popup.wlr_xdg_popup.base.surface); XdgPopup.destroyPopups(xdg_popup.wlr_xdg_popup.base);