Skip to content

feat: rounded corners for frameless windows on Linux - #51459

Merged
VerteDinde merged 4 commits into
electron:mainfrom
mitchchn:mitch/linux-rounded-corners
Jun 23, 2026
Merged

VerteDinde merged 4 commits into
electron:mainfrom
mitchchn:mitch/linux-rounded-corners

Conversation

@mitchchn

@mitchchn mitchchn commented May 2, 2026 •

Copy link
Copy Markdown
Member

Description of Change

Fixes #33036.

Merge after #51458.

Can only backport to 43.x.

Depends on #51458, #51161.

image

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:

  • 6px (Qt and the frames which KDE 6 applies to all non-CSD windows)
  • 8px (Chrome, Firefox, Windows 11, some GTK apps)
  • 10-12px or more if you really love Adwaita (or if you really wish Linux looked more like macOS Tahoe)

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

Release 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: false on the window.

@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label May 2, 2026
@mitchchn
mitchchn marked this pull request as draft May 2, 2026 22:11
@mitchchn
mitchchn force-pushed the mitch/linux-rounded-corners branch 2 times, most recently from 1325260 to 2f99697 Compare May 2, 2026 23:06
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label May 9, 2026

@aiddya aiddya left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM apart from the minor nit.

@mitchchn
mitchchn force-pushed the mitch/linux-rounded-corners branch 3 times, most recently from a7741f9 to 3a8b130 Compare May 22, 2026 22:38
@mitchchn
mitchchn force-pushed the mitch/linux-rounded-corners branch from 3a8b130 to 66e2522 Compare May 30, 2026 20:22
@mitchchn
mitchchn force-pushed the mitch/linux-rounded-corners branch 2 times, most recently from e4b4b7d to 5ae9d69 Compare June 13, 2026 17:53
@mitchchn
mitchchn marked this pull request as ready for review June 13, 2026 17:53
@mitchchn

Copy link
Copy Markdown
Member Author

/request-review @ckerr

@electron-issue-triage
electron-issue-triage Bot requested a review from ckerr June 13, 2026 17:54
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Jun 13, 2026
@mitchchn
mitchchn force-pushed the mitch/linux-rounded-corners branch 2 times, most recently from d8fd121 to adeb25f Compare June 13, 2026 22:54
@ParadaCarleton

Copy link
Copy Markdown

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.

@mitchchn

mitchchn commented Jun 14, 2026 •

Copy link
Copy Markdown
Member Author

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.

@ParadaCarleton

Copy link
Copy Markdown

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.)

@mitchchn
mitchchn force-pushed the mitch/linux-rounded-corners branch from adeb25f to ed45fcb Compare June 15, 2026 20:06
@mitchchn

mitchchn commented Jun 15, 2026 •

Copy link
Copy Markdown
Member Author

This means that for users running those versions of KDE, bottom corners in frameless windows will be rounded (unlike all other apps).

Yup this is true, but it's also the case for any framework that uses CSD, e.g. if you run a modern Adwaita (GNOME) app on KDE, it will round all four corners using a different radius and custom shadows. (See screenshot comparing Adwaita, Qt, and Electron frameless.) The only way to get the exact KDE appearance in Electron would be with frame: true.

image

@VerteDinde VerteDinde added the target/43-x-y PR should also be added to the "43-x-y" branch. label Jun 15, 2026
@mitchchn
mitchchn requested a review from a team as a code owner June 15, 2026 23:29
mitchchn and others added 3 commits June 19, 2026 14:52
Co-authored-by: John Kleinschmidt <[email protected]>
Clarified the configuration option for rounded corners on Linux.
@mitchchn
mitchchn force-pushed the mitch/linux-rounded-corners branch from cd39ed2 to 03c781c Compare June 19, 2026 18:52
@VerteDinde
VerteDinde dismissed jkleinsc’s stale review June 23, 2026 20:37

Changes addressed

@VerteDinde
VerteDinde merged commit 13dae3c into electron:main Jun 23, 2026
74 checks passed
@release-clerk

release-clerk Bot commented Jun 23, 2026

Copy link
Copy Markdown

Release Notes Persisted

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: false on the window.

@trop

trop Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "43-x-y" cleanly;
you will need to perform this backport manually.

@trop trop Bot added needs-manual-bp/43-x-y and removed target/43-x-y PR should also be added to the "43-x-y" branch. labels Jun 23, 2026
@trop

trop Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

@mitchchn has manually backported this PR to "43-x-y", please check out #52111

mitchchn added a commit to mitchchn/electron that referenced this pull request Jun 25, 2026
VerteDinde pushed a commit that referenced this pull request Jun 26, 2026
feat: rounded corners for frameless windows on Linux (#51459)
@trop trop Bot added merged/43-x-y PR was merged to the "43-x-y" branch. and removed in-flight/43-x-y labels Jun 26, 2026
sdziupin pushed a commit to openchamber/openchamber that referenced this pull request Aug 11, 2026
…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
rlevidev pushed a commit to rlevidev/openchamber that referenced this pull request Aug 16, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

44-x-y api-review/approved ✅ merged/43-x-y PR was merged to the "43-x-y" branch. semver/minor backwards-compatible functionality

Projects

No open projects
Status: No status

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Rounded window corners on linux.

8 participants