Added destroyed impl to xdg_v6
Otherwise we could easily crash if we don't deal with it.
@@ -153,6 +153,20 @@ impl XdgV6ShellHandler for XdgV6 {
seat.update_cursor_position(cursor, xcursor_manager, views, None)
);
}
+
+ fn destroyed(&mut self,
+ compositor: CompositorHandle,
+ shell_surface: XdgV6ShellSurfaceHandle) {
+ let surface = shell_surface.into();
+ dehandle!(
+ @compositor = {compositor};
+ let server: &mut ::Server = compositor.into();
+ let ::Server { ref mut views, .. } = *server;
+ if let Some(index) = views.iter().position(|view| view.shell == surface) {
+ views.remove(index);
+ }
+ )
+ }
}
pub struct XdgV6ShellManager;
