rust-windowing / rust-windowing/winit

Retrieving max window size before creation?

Open
#1,906 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

S - enhancement S - platform parity
Dominant language
Rust
Stars
6.2k
Forks
1.3k
Avg merge
2d 19h
Merged PRs (30d)
9

Description

Tracking down a Vulkan validation error leads me to:

  • depth texture size exceeds valid limit (which is screen size)
  • initial (inner, physical) size comes from "find ideal size" logic, which exceeds screen size
  • winit window is created at this "ideal" size, then resized down to the maximum valid size

Is it feasible to clamp the "ideal" size down to the max supported by the screen before creating the window?

Of course in theory the texture creation could be delayed until after the first resize but I don't want to do that since it's not guaranteed to happen — or is it? A quick test on X11 gives me a resize event immediately even with a smaller (valid) initial size.

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.

Research direction

Start by tracing the “find ideal size” logic and the window creation/resizing path described in the report, then reproduce the behavior on X11. Check whether the requested clamp can be applied before creation and whether an initial resize event is guaranteed; done means a validated, clearly scoped resolution to the pre-creation sizing question.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.