Repository navigation
feat: add roundedCorners option for BrowserWindow - #27572
Conversation
samuelmaddock
left a comment
There was a problem hiding this comment.
BrowserWindows with vibrancy options seem to apply their own corner radius size. Would this new option be compatible with this behavior?
electron/shell/browser/native_window_mac.mm
Lines 1242 to 1258 in 95e5193
Would it be possible to instead provide a cornerRadius option where the amount could be specified? If it were 0, rounded corners could be disabled. I'm not too familiar with macOS development to know whether this is supported or not.
Thanks for noticing it, I have fixed the code to work with vibrancy views.
No, the referenced code is used to set corner radius of the vibrancy view so it would not cover the window's rounded corners, macOS does not provide a way to change the corner radius of the window.
Yeah it sounds a better name, I have changed the option's name. |
|
Release Notes Persisted
|
|
I noticed that when using this property |
yes, a repro has been created and the issue is tracked here: #28686 I tried to have a look at the code, but honestly, I'm no obj-c macOS dev sadly, and couldn't figure out much.s |
|
@zcbenz Is it possible that this option is available for windows 11? |
I can't find any Windows API for it. There is also an article on this topic: https://valinet.ro/2022/01/21/Disable-the-rounded-corners-in-Windows-11.html, but it does not imply any windows style to disable the rounded corner. |
I need a solution for this as well. Windowed mode is now "broken" in windows 11 because of rounded corners which is not always the intended use when you want a on purpose a dimensioned canvas. This issue is gone when pressing F11 to go into fullscreen mode or when using kioskmode, which is not ideal either for all use cases. At the same time, the full canvas is still recognised as a square with all the pixels even tho the pixels are like masked above. Windows 10: Windows 11: (corners being cut off) As you can also see, even tho both is set to setPosition(0, 0), windows 11 starts at (1,1) causing a little padding issue. To prevent this I have to subtract with -1 |
|
I found one workaround. By using However, this in turn causes the F11 key only to fullscreen, I cannot longer back out from fullscreen with F11, however I can still resize it from the mouse in the bottom corner. |
|
I can't use roundedCorners: true in windows .(Is it just for macOS??) |
|
Nice! After searching for a while, I finally found it!👏👏👏 |


Description of Change
Add an option to remove rounded corners of frameless windows on macOS, close #414.
Checklist
npm testpassesRelease Notes
Notes: Add
roundedCornersoption forBrowserWindow.