Skip to content

win.center() shrinks frameless windows on Linux and Windows #51731

@mitchchn

Description

@mitchchn

Preflight Checklist

Electron Version

42.2.0

What operating system(s) are you using?

Windows, Other Linux

Operating System Version

Windows 11 25H2, CachyOS (Wayland)

What arch are you using?

x64

Last Known Working Electron version

41.0.0

Does the issue also appear in Chromium / Google Chrome?

No

Expected Behavior

Centering a window with frame: false should center it (Windows/X11) or do nothing (Wayland).

Actual Behavior

The window shrinks.

Testcase Gist URL

https://gist.github.com/mitchchn/5455055d090ede993ebfbe0094dfd2ba

Additional Information

This is because the NativeWindowViews::Center() API does not account for insets which now exist on frameless windows on both Linux and Windows.

Metadata

Metadata

Assignees

Type

No fields configured for Bug.

Projects

Status
🔄 Follow Up Before Stable

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions