You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was not really an issue until now because I can simply avoid calling Window::set_inner_size(). But later I discovered that switching to fullscreen and changing the scale factor will trigger a call to width() and height() by Winit I can't prevent.
I have two proposals to fix this:
Detect the failure when calling HtmlCanvasElement::set_width() and just do nothing in that case. This is simple, but would require introducing custom wasm-bindgen imports because set_width() is not marked with #[catch]. This can't be fixed upstream because it's a breaking change.
Introduce a new method to WindowExtWebSys to actually call the transferControlToOffscreen() for the user, storing a flag somewhere that the canvas is now disconnected.
Happy to make a PR of course.
The text was updated successfully, but these errors were encountered:
I am using
transferControlToOffscreen()
to draw in a different thread, which unfortunately invalidates any calls towidth()
andheight()
.This was not really an issue until now because I can simply avoid calling
Window::set_inner_size()
. But later I discovered that switching to fullscreen and changing the scale factor will trigger a call towidth()
andheight()
by Winit I can't prevent.I have two proposals to fix this:
HtmlCanvasElement::set_width()
and just do nothing in that case. This is simple, but would require introducing customwasm-bindgen
imports becauseset_width()
is not marked with#[catch]
. This can't be fixed upstream because it's a breaking change.WindowExtWebSys
to actually call thetransferControlToOffscreen()
for the user, storing a flag somewhere that the canvas is now disconnected.Happy to make a PR of course.
The text was updated successfully, but these errors were encountered: