mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 23:23:14 -04:00
Improve macOS/iOS/Web thread safety
Co-authored-by: daxpedda <daxpedda@gmail.com>
This commit is contained in:
committed by
Kirill Chibisov
parent
65c2482d74
commit
4e6ce00ec5
@@ -31,7 +31,7 @@ use crate::event::Event;
|
||||
use crate::event_loop::ControlFlow;
|
||||
use crate::event_loop::EventLoop;
|
||||
use crate::event_loop::EventLoopWindowTarget;
|
||||
use crate::window::WindowBuilder;
|
||||
use crate::window::{Window, WindowBuilder};
|
||||
|
||||
use web_sys::HtmlCanvasElement;
|
||||
|
||||
@@ -40,6 +40,13 @@ pub trait WindowExtWebSys {
|
||||
fn canvas(&self) -> Option<HtmlCanvasElement>;
|
||||
}
|
||||
|
||||
impl WindowExtWebSys for Window {
|
||||
#[inline]
|
||||
fn canvas(&self) -> Option<HtmlCanvasElement> {
|
||||
self.window.canvas()
|
||||
}
|
||||
}
|
||||
|
||||
pub trait WindowBuilderExtWebSys {
|
||||
/// Pass an [`HtmlCanvasElement`] to be used for this [`Window`](crate::window::Window). If
|
||||
/// [`None`], [`WindowBuilder::build()`] will create one.
|
||||
|
||||
Reference in New Issue
Block a user