Skip to content

Frameless BrowserWindow.getBounds() inflates by resize-hit insets after setResizable(true → false) on Windows (regression in 41.2.1 from #50863) #51244

Closed

Description

@gdavidkov

Preflight Checklist

Electron Version

41.2.1, 41.2.2, 43.0.0-nightly.20260421

What operating system(s) are you using?

Windows

Operating System Version

Windows 11 Pro 10.0.26200, scaleFactor 1.375

What arch are you using?

x64

Last Known Working Electron version

41.2.0

Does the issue also appear in Chromium / Google Chrome?

I don't know how to test

Expected Behavior

On a frameless BrowserWindow, calling setResizable(false) should not change the values returned by getBounds() / getContentBounds(). The window's logical rect should remain equal to the rect passed to setBounds().

Actual Behavior

After setResizable(true → false) on a frameless window, getBounds() and getContentBounds() both report a rect inflated by the resize-hit insets introduced in #50863:

  • x: -8
  • width: +16 (8 left + 8 right)
  • height: +9 (0 top + 9 bottom)

The inflation is steady-state (persists indefinitely). getContentBounds() equals getBounds() at this point, so the expanded hit-target rect is being reported as both the window rect and the content rect rather than kept as a hit-test-only extension outside the window.

Bisect (same harness, same machine, scaleFactor 1.375):

Electron t1 delta after setBounds t2 delta after setResizable(false)
41.2.0 {x:0,y:0,w:0,h:1} {x:0,y:0,w:0,h:1} ✅
41.2.1 {x:0,y:0,w:0,h:1} {x:-8,y:0,w:16,h:9} ❌
41.2.2 {x:0,y:0,w:0,h:1} {x:-8,y:0,w:16,h:9} ❌
43.0.0-nightly.20260421 {x:0,y:0,w:0,h:1} {x:-8,y:0,w:16,h:9} ❌

The only change between 41.2.0 and 41.2.1 that touches this path is #50863.

Sample output (43.0.0-nightly.20260421):

t1 - after setBounds(requested)
  requested  : {"x":200,"y":200,"width":400,"height":300}
  getBounds  : {"x":200,"y":200,"width":400,"height":301}
  delta      : {"x":0,"y":0,"w":0,"h":1}         <-- DPR rounding only

t2 - IMMEDIATELY after setResizable(false)
  requested  : {"x":200,"y":200,"width":400,"height":300}
  getBounds  : {"x":192,"y":200,"width":416,"height":309}
  getContent : {"x":192,"y":200,"width":416,"height":309}
  delta      : {"x":-8,"y":0,"w":16,"h":9}       <-- BUG

t3 - 50 ms later (inflation persists)
  delta      : {"x":-8,"y":0,"w":16,"h":9}

Testcase Gist URL

https://gist.github.com/c833fe56f3159fcfce90853a64cb64cd

Additional Information

No response

Activity

  1. added theissue type on Apr 22, 2026
  2. added
    has-repro-gist
    on Apr 22, 2026
  3. moved this to 👀 Unsorted Items in 41-x-yon Apr 22, 2026
  4. nikwen commented on Apr 22, 2026

    @nikwen
    Member

    Thanks for reporting this issue, investigating it, and including a great repro!

    Range: v41.2.0...v41.2.1

  5. added
    bug/regression ↩️
    on Apr 22, 2026
  6. moved this from 👀 Unsorted Items to 🔄 Follow Up Before Stable in 41-x-yon Apr 22, 2026
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 🪲bug/regression ↩️component/BrowserWindowhas-repro-gistplatform/windows

    Type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions