Skip to content

Let Window::inner_size() return None if the Window isn't "ready" yet #2863

@daxpedda

Description

@daxpedda

I've heard this come up many times before, but when using Winit to render stuff, users often have to check for the window size not to be zero.

I've encountered this before in X11, but I don't know the story behind this on other backends. For Wasm, it's easy to hit this problem at application startup, where the canvas isn't even inserted yet into the DOM, where it makes perfect sense to return None in Window::inner_size(). See #2859 (comment) which spawned this issue.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions