rust-windowing / rust-windowing/winit

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

Open
#2,863 2 comments 0 reactions 1 assignee View on GitHub

@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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.