rust-windowing / rust-windowing/winit
Let `Window::inner_size()` return `None` if the Window isn't "ready" yet
Open
@daxpedda is already working on this.
Since Jun 9, 2023.
C - needs discussion
S - enhancement
- Dominant language
- Rust
- Stars
- 6.2k
- Forks
- 1.3k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 9
Description
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 https://github.com/rust-windowing/winit/pull/2859#discussion_r1222452529 which spawned this issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.