Skip to content

Windows with frame: true are smaller than they should be on Windows #50783

Closed as not planned

Description

@mitchchn

Preflight Checklist

Electron Version

41.1.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

An 800x600 window with frame: true should measure 800x600 including the titlebar.

Actual Behavior

The window measures 784x592, even though getBounds() and other APIs report 800x600. You can measure with the screenshot tool (assuming 100% scaling) or simply by creating a window with a frame and dragging it on top of one without.

Image Image

Testcase Gist URL

https://gist.github.com/f663c54e89ca040de882ca00dabbc701

Additional Information

The shrinking happens because getBounds() and setBounds() operate directly on the invisible widget (HWND). The visible part of the window gets shrunk down by Chromium to fit resize insets (8px on each side and bottom, so width-16px, height-8px). As a result, windows end up smaller and with less usable space than they are supposed to have.

This isn't an issue in Chromium where developers do not have direct control over window dimensions, but it is in Electron. Even if you account for the space that's intentionally taken up by the titlebar/menubar when useContentSize: false, the content area ends up too small: it should be ~800x543, not 784x535.

(This is not a case of the "window frame" taking up the space, which would be understandable. These insets are only present to support resize hit targets.)

This problem was recently addressed on Linux (#49209) and can be solved the same way on Windows. #50706 addresses it for frameless windows with external resize targets.

Activity

  1. added theissue type on Apr 7, 2026
  2. added
    has-repro-gist
    on Apr 7, 2026
  3. moved this to 👀 Unsorted Items in 41-x-yon Apr 7, 2026
  4. moved this from 👀 Unsorted Items to 👍 Does Not Block Stable in 41-x-yon Apr 15, 2026
  5. electron-issue-triage commented on Jul 7, 2026

    @electron-issue-triage

    This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

  6. moved this to 👀 Unsorted Items in 44-x-yon Jul 7, 2026
  7. mitchchn commented on Jul 7, 2026

    @mitchchn
    MemberAuthor

    Bump :)

  8. removed this from 44-x-yon Jul 8, 2026
  9. thorsent commented on Jul 15, 2026

    @thorsent

    We're hitting this one too. Note the 16 pixels of empty space on this full width frameless window.

    Note for a workaround, setting thickFrame: false brings the scaling back to normal. Resizing with edge drag apparently continue to work even with thickFrame disabled.

    Image
  10. thorsent commented on Jul 15, 2026

    @thorsent

    Possibly related issue: #51679

  11. electron-issue-triage commented on Oct 14, 2026

    @electron-issue-triage

    This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

  12. electron-issue-triage commented on Nov 14, 2026

    @electron-issue-triage

    This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a supported version of Electron please open a new issue and include instructions for reproducing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    41-x-ybug 🪲component/BaseWindowhas-repro-gistplatform/windowsstale

    Type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions