rust-windowing / rust-windowing/winit

Add methods for retrieving exact DPI

Open
#920 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

C - needs discussion DS - android DS - appkit DS - uikit DS - wayland DS - win32 DS - x11 S - api S - enhancement
Dominant language
Rust
Stars
6.2k
Forks
1.3k
Avg merge
2d 19h
Merged PRs (30d)
9

Description

Right now, we have the hidpi_factor method, which lets you obtain a scaling factor for the entire application. However, we don't have methods for retrieving the OS-reported DPI. That value is useful in several contexts (such as font rendering) and afaik can be calculated differently on different operating systems.

Should we expose that value? On Windows, at least, we're already doing most of the work to retrieve it in the hidpi_factor calculations, so exposing this would be a fairly simple extension of that. I'm not entirely sure what the situation is on other platforms, though.

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 with the existing hidpi_factor entry point and trace its Windows DPI retrieval path, then investigate how the other supported platforms report DPI. Done means a decided cross-platform API for exact OS-reported DPI, with behavior verified for the supported platforms.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.