Skip to content

fix: improved the appearance of shadows and borders on frameless windows on Wayland#50007

Merged
jkleinsc merged 5 commits intoelectron:mainfrom
mitchchn:mitch/wayland-better-frameless-corners
Mar 11, 2026
Merged

fix: improved the appearance of shadows and borders on frameless windows on Wayland#50007
jkleinsc merged 5 commits intoelectron:mainfrom
mitchchn:mitch/wayland-better-frameless-corners

Conversation

@mitchchn
Copy link
Member

@mitchchn mitchchn commented Mar 2, 2026

Description of Change

#49295 introduced CSD for frameless windows on Wayland, but it didn't look quite right. The shadows did not extend to the top corners of the frame, they had the wrong intensity, and they didn't reflect active states in all desktop environments. This is because the FrameProvider I used is intended to draw CSD for GTK frames with titlebars, not completely frameless windows.

I added another strategy based on a different frame painter which is also used in Chromium. Electron now follows Chromium's pattern of selecting between different layout strategies (gtk frame provider, custom, base) depending on type of CSD and environment.

Longer term, we may want to write our own CSD painting strategy to handle Electron's use cases which differ somewhat from Chrome. But the overall layout architecture should be suitable going forward. This change also unblocks support for rounded corners on Linux, but that will come next.

(Apologies @ckerr for dropping this on you right after that huge PR you just looked at! Most of the LoC churn here is a re-organization of the new layout class to better line up with Chromium and to support different strategies.)

Before

image

After

image

Checklist

Release Notes

Notes: Improved the appearance of shadows and borders on frameless windows on Wayland.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Mar 2, 2026
@mitchchn mitchchn changed the title fix: improved the appearance of shadows and corners on frameless windows on Wayland fix: improved the appearance of shadows and borders on frameless windows on Wayland Mar 2, 2026
@mitchchn mitchchn force-pushed the mitch/wayland-better-frameless-corners branch from 18af1db to 5a385b6 Compare March 2, 2026 14:26
@mitchchn mitchchn closed this Mar 2, 2026
@mitchchn mitchchn reopened this Mar 2, 2026
@mitchchn
Copy link
Member Author

mitchchn commented Mar 2, 2026

/request-review @ckerr

@ckerr ckerr added semver/patch backwards-compatible bug fixes wayland target/41-x-y PR should also be added to the "41-x-y" branch. labels Mar 3, 2026
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Mar 3, 2026
@ckerr
Copy link
Member

ckerr commented Mar 3, 2026

Marking as target/41-x-y since this fixes up code that landed in main (#49295) and 41-x-y (#49885)

@codebytere codebytere requested a review from ckerr March 4, 2026 15:15
@ckerr
Copy link
Member

ckerr commented Mar 5, 2026

@codebytere @mitchchn will review before EOD

@ckerr
Copy link
Member

ckerr commented Mar 6, 2026

@codebytere @mitchchn will review before EOD

Ugh, you'd think after doing this for as long as I have, I'd've learned to make promises I can't keep. Reviewing it now 😄

mitchchn and others added 2 commits March 6, 2026 12:55
Remove unneeded virtual methods

Co-authored-by: Charles Kerr <charles@charleskerr.com>
@jkleinsc jkleinsc merged commit 11f28ac into electron:main Mar 11, 2026
107 of 108 checks passed
@release-clerk
Copy link

release-clerk bot commented Mar 11, 2026

Release Notes Persisted

Improved the appearance of shadows and borders on frameless windows on Wayland.

trop bot added a commit that referenced this pull request Mar 11, 2026
…ows on Wayland (#50007)

* remove painting from linux frame layout

* use chromium csd strategy for frameless windows

* Apply suggestions from code review

Remove unneeded virtual methods

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* removed inline destructors

---------

Co-authored-by: Charles Kerr <charles@charleskerr.com>

Co-authored-by: Mitchell Cohen <mitch.cohen@me.com>
@trop
Copy link
Contributor

trop bot commented Mar 11, 2026

I have automatically backported this PR to "41-x-y", please check out #50213

@trop trop bot added in-flight/41-x-y and removed target/41-x-y PR should also be added to the "41-x-y" branch. labels Mar 11, 2026
jkleinsc pushed a commit that referenced this pull request Mar 19, 2026
…ows on Wayland (#50213)

fix: improved the appearance of shadows and borders on frameless windows on Wayland (#50007)

* remove painting from linux frame layout

* use chromium csd strategy for frameless windows

* Apply suggestions from code review

Remove unneeded virtual methods



* removed inline destructors

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Mitchell Cohen <mitch.cohen@me.com>
@trop trop bot added merged/41-x-y PR was merged to the "41-x-y" branch. and removed in-flight/41-x-y labels Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/41-x-y PR was merged to the "41-x-y" branch. semver/patch backwards-compatible bug fixes wayland

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants