diff --git a/src/desktop/wayland/popup/manager.rs b/src/desktop/wayland/popup/manager.rs index 6d26739407..3a6bc76098 100644 --- a/src/desktop/wayland/popup/manager.rs +++ b/src/desktop/wayland/popup/manager.rs @@ -159,7 +159,7 @@ impl PopupManager { pub fn find_popup(&self, surface: &WlSurface) -> Option { self.unmapped_popups .iter() - .find(|p| p.wl_surface() == surface) + .find(|p| p.wl_surface() == surface && p.alive()) .cloned() .or_else(|| { self.popup_trees @@ -287,6 +287,7 @@ impl PopupTree { .lock() .unwrap() .iter() + .filter(|node| node.surface.alive()) .flat_map(|n| n.iter_popups_relative_to((0, 0)).map(|(p, l)| (p.clone(), l))) .collect::>() .into_iter() @@ -346,6 +347,7 @@ impl PopupNode { let relative_to = loc.into() + self.surface.location(); self.children .iter() + .filter(|node| node.surface.alive()) .flat_map(move |x| { Box::new(x.iter_popups_relative_to(relative_to)) as Box)>>