On Web, use the new WebCanvasWindowHandle (#3270)

This commit is contained in:
daxpedda 2023-12-22 22:33:50 +01:00 committed by GitHub
parent 2c15de7cf9
commit 8cd3aaa8a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 54 additions and 20 deletions

View file

@ -1530,10 +1530,7 @@ impl Window {
#[cfg(feature = "rwh_06")]
impl rwh_06::HasWindowHandle for Window {
fn window_handle(&self) -> Result<rwh_06::WindowHandle<'_>, rwh_06::HandleError> {
let raw = self
.window
.maybe_wait_on_main(|w| w.raw_window_handle_rwh_06().map(SendSyncWrapper))?
.0;
let raw = self.window.raw_window_handle_rwh_06()?;
// SAFETY: The window handle will never be deallocated while the window is alive.
Ok(unsafe { rwh_06::WindowHandle::borrow_raw(raw) })