Skip to content

Fractional / HIDPI support (Windows) #49

@Miaourt

Description

@Miaourt

Follow-up of webview/webview#54

In short, on Windows 10 (maybe 8 and 7, can't check), there is an option to use fractional resolutions for the interface (and all application), meaning that you can pick 100%, 125%, 150% 175%, 200% and so on.

The thing is, fractional pixels doesn't exists, where 100% and 200% are simple to implement since you just have to double the pixel's size (2x2 instead of 1x1), in-between values are more tricky.

Windows seems to rely on two different tricks to support those :

  1. Displaying properly "fractional" pixels using (unknown to me) wizardry .
  2. A fallback that render the software at a "normal" scaling (100%) and then upscale the output to the desired scaling (125%) resulting in blurry renders.

Tauri, per default, is using the 2nd trick, resulting in blurry applications :
Screenshot of the issue, with a top Windows which is Firefox displaying the application properly, and Tauri being blurred
Screenshot of the issue, with a top window which is Firefox displaying the application properly, and the bottom window a Tauri app being blurred

Steps to reproduce this behaviour:

  1. In the Windows 10's system settings, set the scaling to a fractional one.
  2. Start a Tauri project
  3. Build / Run dev
  4. See the blurriness

Thankfully, thanks to @Ciantic works, it seems to be pretty trivial to fix this issue, here is the solution provided by them : webview/webview#54 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions