diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c8522a5..4b536dba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Monitor enumeration on Windows is now implemented using `EnumDisplayMonitors` instead of `EnumDisplayDevices`. This changes the value returned by `MonitorId::get_name()`. - On Windows added `MonitorIdExt::hmonitor` method +- Impl `Clone` for `EventsLoopProxy` # Version 0.8.3 (2017-10-11) diff --git a/src/lib.rs b/src/lib.rs index 90653659..10056214 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -246,6 +246,7 @@ impl EventsLoop { } /// Used to wake up the `EventsLoop` from another thread. +#[derive(Clone)] pub struct EventsLoopProxy { events_loop_proxy: platform::EventsLoopProxy, } diff --git a/src/platform/android/mod.rs b/src/platform/android/mod.rs index a3caa2f4..3a78541f 100644 --- a/src/platform/android/mod.rs +++ b/src/platform/android/mod.rs @@ -20,6 +20,7 @@ pub struct EventsLoop { event_rx: Receiver, } +#[derive(Clone)] pub struct EventsLoopProxy; impl EventsLoop { diff --git a/src/platform/emscripten/mod.rs b/src/platform/emscripten/mod.rs index d72c4e44..0e458469 100644 --- a/src/platform/emscripten/mod.rs +++ b/src/platform/emscripten/mod.rs @@ -68,6 +68,7 @@ pub fn set_main_loop_callback(callback : F) where F : FnMut() { } } +#[derive(Clone)] pub struct EventsLoopProxy; impl EventsLoopProxy { diff --git a/src/platform/ios/mod.rs b/src/platform/ios/mod.rs index 2542b673..e6b4dc45 100644 --- a/src/platform/ios/mod.rs +++ b/src/platform/ios/mod.rs @@ -156,6 +156,7 @@ pub struct EventsLoop { delegate_state: *mut DelegateState } +#[derive(Clone)] pub struct EventsLoopProxy; impl EventsLoop { diff --git a/src/platform/linux/mod.rs b/src/platform/linux/mod.rs index 520e75ba..fc88a3a8 100644 --- a/src/platform/linux/mod.rs +++ b/src/platform/linux/mod.rs @@ -297,6 +297,7 @@ pub enum EventsLoop { X(x11::EventsLoop) } +#[derive(Clone)] pub enum EventsLoopProxy { X(x11::EventsLoopProxy), Wayland(wayland::EventsLoopProxy), diff --git a/src/platform/linux/wayland/event_loop.rs b/src/platform/linux/wayland/event_loop.rs index 27c4d450..46046870 100644 --- a/src/platform/linux/wayland/event_loop.rs +++ b/src/platform/linux/wayland/event_loop.rs @@ -76,6 +76,7 @@ pub struct EventsLoop { // A handle that can be sent across threads and used to wake up the `EventsLoop`. // // We should only try and wake up the `EventsLoop` if it still exists, so we hold Weak ptrs. +#[derive(Clone)] pub struct EventsLoopProxy { display: Weak, pending_wakeup: Weak, diff --git a/src/platform/linux/x11/mod.rs b/src/platform/linux/x11/mod.rs index 2243b3b2..5f749981 100644 --- a/src/platform/linux/x11/mod.rs +++ b/src/platform/linux/x11/mod.rs @@ -43,6 +43,7 @@ pub struct EventsLoop { wakeup_dummy_window: ffi::Window, } +#[derive(Clone)] pub struct EventsLoopProxy { pending_wakeup: Weak, display: Weak, diff --git a/src/platform/macos/events_loop.rs b/src/platform/macos/events_loop.rs index 75963368..f9eaf81d 100644 --- a/src/platform/macos/events_loop.rs +++ b/src/platform/macos/events_loop.rs @@ -29,6 +29,7 @@ pub struct Shared { user_callback: UserCallback, } +#[derive(Clone)] pub struct Proxy {} struct Modifiers { diff --git a/src/platform/windows/events_loop.rs b/src/platform/windows/events_loop.rs index ddb2c5fa..7213bcdc 100644 --- a/src/platform/windows/events_loop.rs +++ b/src/platform/windows/events_loop.rs @@ -243,6 +243,7 @@ impl Drop for EventsLoop { } } +#[derive(Clone)] pub struct EventsLoopProxy { thread_id: winapi::DWORD, }