subsurface_widget: Clear subsurface list after calls to ::draw()
Otherwise the `draw` call in response to `AboutToWait` causes this list to grow, and eventually hit errors in `sendmsg` due to too many buffered file descriptors from creating subsurfaces. Probably the number of places `UserInterface::draw` are called should be cleaned up. And it shouldn't be called in `AboutToWiat` like this. Some improvements could probably be made in upstream iced.
This commit is contained in:
parent
c18f5f6dda
commit
dd9576d94e
3 changed files with 12 additions and 0 deletions
|
|
@ -1133,6 +1133,7 @@ async fn run_instance<P>(
|
|||
},
|
||||
cursor,
|
||||
);
|
||||
platform_specific_handler.clear_subsurface_list();
|
||||
draw_span.finish();
|
||||
|
||||
if let user_interface::State::Updated {
|
||||
|
|
|
|||
|
|
@ -72,6 +72,13 @@ impl PlatformSpecific {
|
|||
}
|
||||
}
|
||||
|
||||
pub(crate) fn clear_subsurface_list(&mut self) {
|
||||
#[cfg(all(feature = "wayland", target_os = "linux"))]
|
||||
{
|
||||
self.wayland.clear_subsurface_list();
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn update_subsurfaces(
|
||||
&mut self,
|
||||
id: window::Id,
|
||||
|
|
|
|||
|
|
@ -181,6 +181,10 @@ impl WaylandSpecific {
|
|||
};
|
||||
}
|
||||
|
||||
pub(crate) fn clear_subsurface_list(&mut self) {
|
||||
let _ = crate::subsurface_widget::take_subsurfaces();
|
||||
}
|
||||
|
||||
pub(crate) fn update_subsurfaces(
|
||||
&mut self,
|
||||
id: window::Id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue