rust-windowing / rust-windowing/winit

Minimum and Maximum size become incorrect when the HiDPI factor changes

Open
#940 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

D - easy DS - appkit DS - uikit DS - wayland DS - x11 H - good first issue H - help wanted P - normal
Dominant language
Rust
Stars
6.2k
Forks
1.3k
Avg merge
2d 19h
Merged PRs (30d)
9

Description

On most platforms, the set_min_inner_size and set_max_inner_size functions don't handle HiDPI factor changes properly.

Most of the current implementations perform the coordinate-system conversion within the calls to set_{whatever}_size, and store the internal size bounds as either a PhysicalSize or a LogicalSize. That's almost the correct behavior, but it breaks when the window's HiDPI factor changes: if set_{whatever}_size had to do a coordinate system conversion from logical->physical or physical->logical, the size bound will no longer be accurate to what the user requested, since the coordinate system conversion will have changed. Winit should store the Size parameter when one of those functions is called, and update the value passed to the OS whenever a HiDPIFactorChanged event is received.

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 locating the platform implementations of set_min_inner_size and set_max_inner_size, then trace how HiDPIFactorChanged events are handled. Verify that the requested Size remains accurate after the HiDPI factor changes and that the updated value passed to the OS matches the original request.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.