fix(winit): Cleanup surface_subsurfaces on parent window removal
This commit is contained in:
parent
89af847930
commit
78153e6240
3 changed files with 226 additions and 1 deletions
|
|
@ -78,6 +78,16 @@ impl PlatformSpecific {
|
|||
}
|
||||
}
|
||||
|
||||
pub(crate) fn retain_subsurfaces<F: Fn(window::Id) -> bool>(
|
||||
&mut self,
|
||||
keep: F,
|
||||
) {
|
||||
#[cfg(all(feature = "wayland", target_os = "linux"))]
|
||||
{
|
||||
self.wayland.retain_subsurfaces(keep);
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn clear_subsurface_list(&mut self) {
|
||||
#[cfg(all(feature = "wayland", target_os = "linux"))]
|
||||
{
|
||||
|
|
|
|||
|
|
@ -212,6 +212,13 @@ impl WaylandSpecific {
|
|||
};
|
||||
}
|
||||
|
||||
pub(crate) fn retain_subsurfaces<F: Fn(window::Id) -> bool>(
|
||||
&mut self,
|
||||
keep: F,
|
||||
) {
|
||||
self.surface_subsurfaces.retain(|k, v| keep(*k))
|
||||
}
|
||||
|
||||
pub(crate) fn clear_subsurface_list(&mut self) {
|
||||
let _ = crate::subsurface_widget::take_subsurfaces();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue