mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-26 14:49:07 -04:00
Add Send and Sync to OwnedDisplayHandle (#4509)
This commit is contained in:
@@ -176,11 +176,11 @@ pub trait EventLoopProxyProvider: Send + Sync + Debug {
|
|||||||
/// - A reference-counted pointer to the underlying type.
|
/// - A reference-counted pointer to the underlying type.
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct OwnedDisplayHandle {
|
pub struct OwnedDisplayHandle {
|
||||||
pub(crate) handle: Arc<dyn HasDisplayHandle>,
|
pub(crate) handle: Arc<dyn HasDisplayHandle + Send + Sync>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl OwnedDisplayHandle {
|
impl OwnedDisplayHandle {
|
||||||
pub fn new(handle: Arc<dyn HasDisplayHandle>) -> Self {
|
pub fn new(handle: Arc<dyn HasDisplayHandle + Send + Sync>) -> Self {
|
||||||
Self { handle }
|
Self { handle }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ changelog entry.
|
|||||||
- Add `keyboard` support for OpenHarmony.
|
- Add `keyboard` support for OpenHarmony.
|
||||||
- On iOS, add Apple Pencil support with force, altitude, and azimuth data.
|
- On iOS, add Apple Pencil support with force, altitude, and azimuth data.
|
||||||
- On Redox, add support for missing keyboard scancodes.
|
- On Redox, add support for missing keyboard scancodes.
|
||||||
|
- Implement `Send` and `Sync` for `OwnedDisplayHandle`.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
|||||||
@@ -28,3 +28,8 @@ fn custom_cursor_send() {
|
|||||||
needs_send::<winit::cursor::CustomCursorSource>();
|
needs_send::<winit::cursor::CustomCursorSource>();
|
||||||
needs_send::<winit::cursor::CustomCursor>();
|
needs_send::<winit::cursor::CustomCursor>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn owned_display_handle_send() {
|
||||||
|
needs_send::<winit::event_loop::OwnedDisplayHandle>();
|
||||||
|
}
|
||||||
|
|||||||
@@ -21,3 +21,8 @@ fn custom_cursor_sync() {
|
|||||||
needs_sync::<winit::cursor::CustomCursorSource>();
|
needs_sync::<winit::cursor::CustomCursorSource>();
|
||||||
needs_sync::<winit::cursor::CustomCursor>();
|
needs_sync::<winit::cursor::CustomCursor>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn owned_display_handle_sync() {
|
||||||
|
needs_sync::<winit::event_loop::OwnedDisplayHandle>();
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user