wayland.shell: implement Clone for toplevels
This commit is contained in:
parent
ca7e91a98c
commit
33a9e242ed
|
@ -92,6 +92,17 @@ pub struct ShellSurface<R> {
|
|||
token: CompositorToken<R>,
|
||||
}
|
||||
|
||||
// We implement Clone manually because #[derive(..)] would require R: Clone.
|
||||
impl<R> Clone for ShellSurface<R> {
|
||||
fn clone(&self) -> Self {
|
||||
Self {
|
||||
wl_surface: self.wl_surface.clone(),
|
||||
shell_surface: self.shell_surface.clone(),
|
||||
token: self.token.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<R> ShellSurface<R>
|
||||
where
|
||||
R: Role<ShellSurfaceRole> + 'static,
|
||||
|
|
|
@ -472,6 +472,7 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub(crate) enum ToplevelKind {
|
||||
Xdg(xdg_toplevel::XdgToplevel),
|
||||
ZxdgV6(zxdg_toplevel_v6::ZxdgToplevelV6),
|
||||
|
@ -484,6 +485,17 @@ pub struct ToplevelSurface<R> {
|
|||
token: CompositorToken<R>,
|
||||
}
|
||||
|
||||
// We implement Clone manually because #[derive(..)] would require R: Clone.
|
||||
impl<R> Clone for ToplevelSurface<R> {
|
||||
fn clone(&self) -> Self {
|
||||
Self {
|
||||
wl_surface: self.wl_surface.clone(),
|
||||
shell_surface: self.shell_surface.clone(),
|
||||
token: self.token.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<R> ToplevelSurface<R>
|
||||
where
|
||||
R: Role<XdgSurfaceRole> + 'static,
|
||||
|
|
Loading…
Reference in New Issue