diff --git a/src/window.rs b/src/window.rs index 0039241..183b6be 100644 --- a/src/window.rs +++ b/src/window.rs @@ -52,12 +52,21 @@ pub enum EventLoopSendError } /// Allows user events to be sent to the event loop from other threads. -#[derive(Clone)] pub struct UserEventSender { inner: UserEventSenderInnerType } +impl Clone for UserEventSender +{ + fn clone(&self) -> Self + { + UserEventSender { + inner: self.inner.clone() + } + } +} + impl UserEventSender { pub(crate) fn new(inner: UserEventSenderInnerType) -> Self diff --git a/src/window_internal_glutin.rs b/src/window_internal_glutin.rs index a3fe434..4531dd8 100644 --- a/src/window_internal_glutin.rs +++ b/src/window_internal_glutin.rs @@ -950,12 +950,21 @@ pub(crate) enum UserEventGlutin UserEvent(UserEventType) } -#[derive(Clone)] pub struct UserEventSenderGlutin { event_proxy: EventLoopProxy> } +impl Clone for UserEventSenderGlutin +{ + fn clone(&self) -> Self + { + UserEventSenderGlutin { + event_proxy: self.event_proxy.clone() + } + } +} + impl UserEventSenderGlutin { fn new(event_proxy: EventLoopProxy>) -> Self diff --git a/src/window_internal_web.rs b/src/window_internal_web.rs index 371f308..9249851 100644 --- a/src/window_internal_web.rs +++ b/src/window_internal_web.rs @@ -560,7 +560,6 @@ impl WindowHelperWeb type UserEventSenderActionType = dyn FnMut(UserEventType) -> Result<(), BacktraceError>; -#[derive(Clone)] pub struct UserEventSenderWeb where UserEventType: 'static @@ -568,6 +567,16 @@ where action: Rc>> } +impl Clone for UserEventSenderWeb +{ + fn clone(&self) -> Self + { + UserEventSenderWeb { + action: self.action.clone() + } + } +} + impl UserEventSenderWeb { fn new(action: Rc>>) -> Self