Repository navigation
feat: rounded corners for frameless windows on Linux - #51459
Conversation
1325260 to
2f99697
Compare
aiddya
left a comment
There was a problem hiding this comment.
LGTM apart from the minor nit.
a7741f9 to
3a8b130
Compare
3a8b130 to
66e2522
Compare
e4b4b7d to
5ae9d69
Compare
|
/request-review @ckerr |
d8fd121 to
adeb25f
Compare
|
Hmm, could/should the fix for bottom window corners just be upstreamed into Chromium? That would be less of a hack and would work even on older versions of DEs (e.g. LTS KDE) that don't round bottom corners. |
|
Thanks @ParadaCarleton. This PR is already based on upstream code about as much as it can be. Rounding and masking is driven by Chromium, and the frame view which Electron uses was recently upstreamed as well (https://chromium-review.googlesource.com/c/chromium/src/+/7760061). But Chrome's browser window still has is own design and implementation which is different from a frameless window in Electron. So there is nothing really to "fix" in Chrome that would also apply to Electron. The underlying support for corner rounding is shared, but the projects make their own choices for the unique views and windows they create. As for your other concern, both Electron frameless windows and Chrome use CSD, so the appearance does not depend on support from desktop environments. The corner rounding in this PR will look the same and apply to all four corners everywhere. |
Right so to clarify, what I mean is up until a very recent version, all KDE apps had rounded top corners but flat bottom corners (like Chrome's current behavior). This means that for users running those versions of KDE, bottom corners in frameless windows will be rounded (unlike all other apps). (Honestly, this isn't a big deal, given most KDE users won't be using frameless windows anyway. It definitely shouldn't slow down this PR.) |
adeb25f to
ed45fcb
Compare
Co-authored-by: John Kleinschmidt <[email protected]>
Clarified the configuration option for rounded corners on Linux.
cd39ed2 to
03c781c
Compare
|
Release Notes Persisted
|
|
I was unable to backport this PR to "43-x-y" cleanly; |
feat: rounded corners for frameless windows on Linux (#51459)
…orners (#2765) * feat(desktop): upgrade Electron to 43.3 for Linux frameless rounded corners - electron ^41.2.1 -> ^43.3.0 (electron/electron#51459/#52111: rounded corners for frameless windows on Linux, default-on; disable via roundedCorners: false) - @electron/rebuild ^3.7.0 -> ^4.2.0 to build native modules against the new Electron ABI - pin node-abi to 4.33.0 via root overrides so @electron/rebuild (and electron-builder's internal rebuild) can resolve Electron 43's ABI - README: Electron 43 ships its own fixed extractor (extract-zip 2.0.1 Node-24 unpack bug no longer applies; ensure-electron remains a safety net for interrupted/wrong-arch installs) * chore: re-trigger pr-review after adding visual evidence * fix(desktop): scope node-abi to Electron rebuild tooling * chore: re-trigger pr-review after dependency fix * chore: re-trigger pr-review with drag evidence * chore: retry pr-review after evidence confirmation
…orners (openchamber#2765) * feat(desktop): upgrade Electron to 43.3 for Linux frameless rounded corners - electron ^41.2.1 -> ^43.3.0 (electron/electron#51459/#52111: rounded corners for frameless windows on Linux, default-on; disable via roundedCorners: false) - @electron/rebuild ^3.7.0 -> ^4.2.0 to build native modules against the new Electron ABI - pin node-abi to 4.33.0 via root overrides so @electron/rebuild (and electron-builder's internal rebuild) can resolve Electron 43's ABI - README: Electron 43 ships its own fixed extractor (extract-zip 2.0.1 Node-24 unpack bug no longer applies; ensure-electron remains a safety net for interrupted/wrong-arch installs) * chore: re-trigger pr-review after adding visual evidence * fix(desktop): scope node-abi to Electron rebuild tooling * chore: re-trigger pr-review after dependency fix * chore: re-trigger pr-review with drag evidence * chore: retry pr-review after evidence confirmation

Description of Change
Fixes #33036.
Merge after #51458.
Can only backport to 43.x.
Depends on #51458, #51161.
Gradient courtesy of Grabient.
cc: @aiddya.
Because we are talking about Linux, there isn't one standard value to set for the corner radius of a window, especially for a custom frameless view. There are good arguments to make for:
At the end of the day this decision was too big for me to make according to my own personal aesthetic tastes, so I decided to let upstream decide: the corner radius is pulled directly from Chrome, which uses 8px. The value is already designed to work with this frame/shadow painter and happens to match Windows 11, which is nice for cross-platform app developers.
That said, there's fundamentally no reason why windows can't have arbitrary corner radii, and if people feel strongly about this it could be turned into an API.
About the implementation
On Linux, unlike on Mac and Windows, rounding has to be applied to the actual web contents view, not just the frame.
One caveat with this implementation is that it only rounds the primary web contents view. I am not sure what the appropriate thing would be to do is if there are multiple web views. It is probably out of scope for this PR.
Checklist
npm testpassesRelease Notes
Notes: On Linux, frameless windows now have rounded corners by default, just like on macOS and Windows. Rounded corners can be disabled on all platforms by setting
roundedCorners: falseon the window.