[Bug]: Calling .center() on BrowserWindow with parent now centers relative to parent instead of screen #41956
Closed
3 tasks done
Labels
30-x-y
bug 🪲
has-repro-gist
Issue can be reproduced with code at https://gist.github.com/
platform/linux
platform/windows
status/confirmed
A maintainer reproduced the bug or agreed with the feature
Preflight Checklist
Electron Version
30.0.1
What operating system are you using?
Windows
Operating System Version
Windows 10 Pro 22H2 19045.4291
What arch are you using?
x64
Last Known Working Electron version
27
Expected Behavior
As per documentation for .center() : "Moves window to the center of the screen.".
https://www.electronjs.org/docs/latest/api/browser-window#wincenter
Actual Behavior
When a BrowserWindow has a parent window defined, calling .center() on the child centers the window relative to the parent, not the screen.
Testcase Gist URL
https://gist.github.com/yangannyx/277e71dc348b289cde39e94b4b59d683
Additional Information
This issue does not exist in 27.3.11 but DOES exist in 28.0.0 onwards.
Credit to yangannyx for creating the gist in response to my initial query regarding this on discord.
The text was updated successfully, but these errors were encountered: