Skip to content

fix: CSD window frame tiles properly on Wayland#48765

Merged
codebytere merged 1 commit intoelectron:mainfrom
mitchchn:fix-tiling-client-frame-linux
Nov 7, 2025
Merged

fix: CSD window frame tiles properly on Wayland#48765
codebytere merged 1 commit intoelectron:mainfrom
mitchchn:fix-tiling-client-frame-linux

Conversation

@mitchchn
Copy link
Copy Markdown
Member

@mitchchn mitchchn commented Nov 4, 2025

Description of Change

On Wayland compositors that use CSD (GNOME), tiled windows had a non-tiled appearance with rounded corners and shadows on all sides, and they showed resize handles on all edges.

Reasons for the issue:

  1. A bug in the GNOME compositor on Ubuntu reports all edges as tiled even if only some are. (This also affected Chrome: https://issues.chromium.org/issues/454083284.)
  2. The CSD frame was applying positive insets on all sides of the frame, when only the visible edges should have insets when tiled/maximized.

Some issues with tiling and resize handles were addressed previously in #46155. This PR fully restores the correct tiled appearance and behaviours without regressing those fixes.

Relates to #45916. This PR fixes tiling resize handles for CSD windows, but not (yet) for fully frameless windows (frame: false/WCO) because this technique requires a GTK client frame. This solution will however also apply to frameless windows when they get a client frame + shadows.

Before:

image

After:

image

Checklist

Release Notes

Notes: Corrected the appearance of tiled windows on GNOME (when frame: true), and removed resize handles from tiled edges.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Nov 4, 2025
@ckerr ckerr self-requested a review November 4, 2025 03:13
@codebytere codebytere self-requested a review November 4, 2025 09:06
Copy link
Copy Markdown
Member

@codebytere codebytere left a comment

Choose a reason for hiding this comment

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

@mitchchn i pulled the branch down and ran it - and I still see this:

Screenshot 2025-11-04 at 10 50 49 AM

I'm running Wayland on Ubuntu 24.04, using the default Fiddle. Is there anything I'm missing?

@mitchchn
Copy link
Copy Markdown
Member Author

mitchchn commented Nov 4, 2025

@codebytere this PR is for window tiling which isn't in your screenshot. When you tile left/right, you should now see:

  1. No shadows on the free edge
  2. Square corners on the tiled edges
  3. Resize handles only on the free edge

(If you are talking about the window titlebar buttons being on the wrong side, that was fixed in a different PR, but you can't yet tell in Fiddle because its version of Electron still sets the old environment variable which propagates to child processes.)

@ckerr ckerr added semver/patch backwards-compatible bug fixes target/37-x-y PR should also be added to the "37-x-y" branch. target/38-x-y PR should also be added to the "38-x-y" branch. target/39-x-y PR should also be added to the "39-x-y" branch. labels Nov 4, 2025
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Nov 5, 2025
@codebytere codebytere added target/38-x-y PR should also be added to the "38-x-y" branch. target/39-x-y PR should also be added to the "39-x-y" branch. target/40-x-y PR should also be added to the "40-x-y" branch. and removed target/37-x-y PR should also be added to the "37-x-y" branch. target/38-x-y PR should also be added to the "38-x-y" branch. target/39-x-y PR should also be added to the "39-x-y" branch. labels Nov 6, 2025
@mitchchn mitchchn force-pushed the fix-tiling-client-frame-linux branch from f80520f to 543020a Compare November 6, 2025 20:20
@mitchchn mitchchn force-pushed the fix-tiling-client-frame-linux branch from 543020a to d82d23b Compare November 6, 2025 20:23
@codebytere codebytere merged commit 194ce1a into electron:main Nov 7, 2025
104 of 105 checks passed
@release-clerk
Copy link
Copy Markdown

release-clerk bot commented Nov 7, 2025

Release Notes Persisted

Corrected the appearance of tiled windows on GNOME (when frame: true), and removed resize handles from tiled edges.

@trop
Copy link
Copy Markdown
Contributor

trop bot commented Nov 7, 2025

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

@trop trop bot added the in-flight/39-x-y label Nov 7, 2025
@trop
Copy link
Copy Markdown
Contributor

trop bot commented Nov 7, 2025

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

@trop trop bot removed the target/39-x-y PR should also be added to the "39-x-y" branch. label Nov 7, 2025
@trop
Copy link
Copy Markdown
Contributor

trop bot commented Nov 7, 2025

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

@trop trop bot added in-flight/40-x-y in-flight/38-x-y merged/38-x-y PR was merged to the "38-x-y" branch. merged/40-x-y PR was merged to the "40-x-y" branch. merged/39-x-y PR was merged to the "39-x-y" branch. and removed target/40-x-y PR should also be added to the "40-x-y" branch. target/38-x-y PR should also be added to the "38-x-y" branch. in-flight/38-x-y in-flight/40-x-y in-flight/39-x-y labels Nov 7, 2025
nilayarya pushed a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
fix: CSD window frame tiles properly on Linux
nilayarya added a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
fix: CSD window frame tiles properly on Linux
nilayarya added a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
fix: CSD window frame tiles properly on Linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/38-x-y PR was merged to the "38-x-y" branch. merged/39-x-y PR was merged to the "39-x-y" branch. merged/40-x-y PR was merged to the "40-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants