Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Web backend for rust-windowing/winit#2943 #1

Merged
merged 1 commit into from
Jul 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/platform_impl/web/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ use crate::window::{
WindowAttributes, WindowButtons, WindowId as RootWI, WindowLevel,
};

use raw_window_handle::{RawDisplayHandle, RawWindowHandle, WebDisplayHandle, WebWindowHandle};
use raw_window_handle::{
HandleError, RawDisplayHandle, RawWindowHandle, WebDisplayHandle, WebWindowHandle,
};
use web_sys::HtmlCanvasElement;

use super::r#async::Dispatcher;
Expand Down Expand Up @@ -374,10 +376,10 @@ impl Window {
}

#[inline]
pub fn raw_window_handle(&self) -> RawWindowHandle {
pub fn raw_window_handle(&self) -> Result<RawWindowHandle, HandleError> {
let mut window_handle = WebWindowHandle::empty();
window_handle.id = self.id.0;
RawWindowHandle::Web(window_handle)
Ok(RawWindowHandle::Web(window_handle))
}

#[inline]
Expand Down