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.
This commit is contained in:
Isaac Freund 2022-01-23 20:37:37 +01:00
parent 20ca8a2051
commit b716e262cd
No known key found for this signature in database
GPG Key ID: 86DED400DDFD7A11

View File

@ -96,6 +96,8 @@ pub fn destroy(xdg_popup: *XdgPopup) void {
xdg_popup.new_popup.link.remove(); xdg_popup.new_popup.link.remove();
xdg_popup.new_subsurface.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); Subsurface.destroySubsurfaces(xdg_popup.wlr_xdg_popup.base.surface);
XdgPopup.destroyPopups(xdg_popup.wlr_xdg_popup.base); XdgPopup.destroyPopups(xdg_popup.wlr_xdg_popup.base);