FAQ - Help and questions

Why is my Windows app blurry on a high-DPI screen, and what is DPI awareness?

#high-dpi#windows#manifest#troubleshootingpublished 0 replies0 views
ReplyWatch
Share
Hacker NewsRedditLinkedInE-mail

Short answer

A Windows program that does not declare DPI awareness is treated as unaware, drawn at 96 DPI and stretched as a bitmap, which looks blurry on scaled screens. The fix is to declare per-monitor v2 awareness, in the manifest or through the toolkit, and lay out in logical units.

Checked with not compiled here. This answer follows Microsoft's published documentation on high-DPI desktop applications, read on 2026-12-05. No blurry window was reproduced, and no manifest was built for this thread.

Frequently asked question, written and answered by the Ruststudio team. Replies are open: corrections are welcome.

#1

Answer#

Microsoft's documentation says: "By default, the system considers desktop applications DPI unaware and bitmap-stretches their windows." A DPI-unaware application "render[s] at a fixed DPI value of 96 (100%)", and when it runs on a screen scaled above that, "Windows will stretch the application bitmap to the expected physical size. This results in the application appearing blurry."

The modes, from the same page:

ModeWhat Windows does when the scale changes
Unawarebitmap-stretches (blurry)
Systembitmap-stretches when the scale differs from the one at sign-in (blurry)
Per-Monitordoes not stretch; tells the app, which must resize itself
Per-Monitor V2does not stretch; tells the app, and also scales some non-client parts of the window

Microsoft recommends per-monitor v2 for desktop applications ("It is recommended that applications use PMv2"), available from Windows 10 version 1703. One of the documented ways to mark the process is the application manifest; the page lists "Mark the process as per-monitor DPI aware (V2) using an application manifest (or other method, depending on the UI framework(s) used)" as a first step.

What it means for a Rust app:

  1. If you use a toolkit (egui, iced, Slint, or Tauri's web view), check its documentation and its release notes for high-DPI support on Windows before adding a manifest yourself. A toolkit that handles the scale factor reports it to your code (see the thread on logical and physical pixels), and your layout should use that.
  2. If you call the Windows API yourself, you take on what the page describes: declare the awareness, handle WM_DPICHANGED with the rectangle Windows suggests, and use the DPI-aware versions of the system calls.
  3. Test it. Microsoft's checklist includes moving the window between monitors with different scales and changing the scale while the app runs.

Common mistakes#

  • Fixing blur by forcing awareness without changing the layout. The text becomes sharp but tiny, because nothing scales the UI any more.
  • Testing only at 100 percent.
  • Hard-coding pixel sizes for icons. Provide larger images or draw them as vectors.

Does a manifest change anything on macOS?#

No: the manifest is a Windows mechanism. macOS has its own way of telling the app about the screen scale; check your toolkit's documentation.

Sources#

    QuoteReply
    Share
    Hacker NewsRedditLinkedInE-mail

    No replies yet