Skip to content

Frameless window bounds are not consistent at DPI scales above 100% on Windows #51572

Open

Description

@mitchchn

Preflight Checklist

Electron Version

42.0.1

What operating system(s) are you using?

Windows

Operating System Version

Windows 11 25H2

What arch are you using?

x64

Last Known Working Electron version

No response

Does the issue also appear in Chromium / Google Chrome?

No

Expected Behavior

Set the display scale to 175% in Windows and create an 800x600 window with frame: false. The dimensions of the window, content, and viewport should all be 800x600:

Window: { x: 697, y: 293, width: 800, height: 600 }
Content: { x: 697, y: 293, width: 800, height: 600 }
[9020:0509/104305.113:INFO:CONSOLE:21] "Viewport: 800 x 600", source:  (21)

Actual Behavior

The dimensions are sometimes off by 1-3 px.

Window { x: 705, y: 293, width: 801, height: 601 }
Content { x: 704, y: 293, width: 803, height: 602 }
[7776:0509/104549.114:INFO:CONSOLE:24] "Viewport width: 803, height: 602", source:  (24)

Testcase Gist URL

https://gist.github.com/599154630e98fb1773ba6731feaee5cd

Additional Information

I can reproduce this issue to some extent in versions of Electron as far back as 38.0, but my recent work on resize insets (#50706) has made the drift more obvious (from 1px to 3px depending on scale and the values).

I believe it is caused by inconsistent rounding in Chromium when bounds are provided in DIP pixels.

Activity

  1. added theissue type on May 9, 2026
  2. added
    has-repro-gist
    on May 9, 2026
  3. moved this to 👀 Unsorted Items in 42-x-yon May 9, 2026
  4. added
    status/confirmed
    on May 9, 2026
  5. moved this from 👀 Unsorted Items to 👍 Does Not Block Stable in 42-x-yon May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

42-x-ybug 🪲component/BrowserWindowhas-repro-gistplatform/windowsstatus/confirmed

Type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions