Skip to content

refactor: replace OpaqueFrameView with ElectronFrameViewLinux - #51161

Merged
jkleinsc merged 1 commit into
electron:mainfrom
aiddya:efvl-refactor
May 15, 2026
Merged

jkleinsc merged 1 commit into
electron:mainfrom
aiddya:efvl-refactor

Conversation

@aiddya

@aiddya aiddya commented Apr 20, 2026 •

Copy link
Copy Markdown
Contributor

Description of Change

Replace OpaqueFrameView with ElectronFrameViewLinux, rebased on the new Chromium FrameViewLinux class. This orphans LinuxFrameLayout, which is now removed. ElectronDesktopWindowTreeHostLinux now invokes FrameViewLinux methods on window changes like transparency and shadows.

ElectronFrameViewLayoutLinux extends FrameViewLayoutLinux to handle three modes: shadow-only, WCO, and transparent. It overrides frame geometry methods from the base class for these modes and adds a few new
ones for WCO.

As the base FrameViewLinux class respects user preferences on window controls, ElectronFrameViewLinux has been changed to match. WCO can now show user-configured buttons in either all-trailing, all-leading or a
mix of leading and trailing order.

Instead of drawing an inside resize border for frameless without shadow mode, we instead set shadow to none and let the frame border insets collapse to the resize band. This ensures consistent resize behavior across modes, which is a 10 px band all around the client/frame area. It also allows us to do neat things like runtime toggling of shadows, which has now been implemented on Linux.

Checklist

Release Notes

Notes:

  • Fixed runtime toggling of shadows for frameless windows on Linux.
  • Added support for system-configured button layouts in Window Controls Overlay on Linux.

@aiddya
aiddya requested a review from a team as a code owner April 20, 2026 01:51
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Apr 20, 2026
@aiddya

aiddya commented Apr 20, 2026

Copy link
Copy Markdown
Contributor Author

Depends on #51160

@aiddya
aiddya force-pushed the efvl-refactor branch 4 times, most recently from 7f8ddf8 to eb1ef45 Compare April 26, 2026 00:38
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Apr 27, 2026
@jkleinsc

Copy link
Copy Markdown
Member

@aiddya can you rebase you PR on the latest from main?

@aiddya

aiddya commented Apr 29, 2026

Copy link
Copy Markdown
Contributor Author

Done.

@ckerr
ckerr self-requested a review April 29, 2026 17:12
@aiddya

aiddya commented Apr 30, 2026

Copy link
Copy Markdown
Contributor Author

Fixed the formatting issues.

@mitchchn mitchchn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The only thing I haven't been able to test is an olderX11 environment without shadow/compositing support. But everything works well on Wayland and Xwayland on GNOME and KDE.

Comment thread shell/browser/native_window_views.cc Resolved
Comment thread shell/browser/ui/views/frameless_view.h Resolved
@ckerr ckerr added semver/minor backwards-compatible functionality no-backport labels May 7, 2026
Replace OpaqueFrameView with ElectronFrameViewLinux, rebased on the new
Chromium FrameViewLinux class. This orphans LinuxFrameLayout, which is
now removed. ElectronDesktopWindowTreeHostLinux now invokes
FrameViewLinux methods on window changes like transparency and shadows.

ElectronFrameViewLayoutLinux extends FrameViewLayoutLinux to handle
three modes: shadow-only, WCO, and transparent. It overrides frame
geometry methods from the base class for these modes and adds a few new
ones for WCO.

Assisted-By: Claude Opus 4.6, Claude Code
@release-clerk

release-clerk Bot commented May 15, 2026

Copy link
Copy Markdown

Release Notes Persisted

  • Fixed runtime toggling of shadows for frameless windows on Linux.
  • Added support for system-configured button layouts in Window Controls Overlay on Linux.

@trop

trop Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

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

@trop trop Bot added in-flight/43-x-y and removed target/43-x-y PR should also be added to the "43-x-y" branch. labels May 15, 2026
@aiddya
aiddya deleted the efvl-refactor branch May 16, 2026 14:58
@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 May 16, 2026
@mitchchn mitchchn mentioned this pull request Jun 15, 2026
3 tasks done
adri6412 added a commit to adri6412/osmium-sound-x86 that referenced this pull request Aug 20, 2026
… GTK theme

A light 4px strip runs down the left edge of the panel. It is not the
compositor's border: Chromium draws its own frame around the window on Linux
(ElectronFrameViewLinux, rebased on Chromium's FrameViewLinux in
electron/electron#51161, in every 43.x), a resize band plus a border painted
in the system theme's colours — measured (221,218,214) with a (188,186,182)
outline, which is Adwaita light. The same refactor is where the "consistent
10px resize bands" come from, matching the insets seen on the wire:
set_window_geometry(16, 10, ...) with the shadow, 10/10 with hasShadow off.

Chromium drops that frame when it knows it is fullscreen, but only then —
having the compositor fullscreen the window from outside does not do it. The
window is `resizable: false`, so it refuses the resize the WM's fullscreen
asks of it, and all that changes is which edges of the border land on screen:
a labwc window rule with ToggleFullscreen turned one visible strip into two
(left and bottom). So the window asks for fullscreen itself.

Only on a session that has a compositor: the X11 rollback session runs bare
with no window manager, so nobody would honour the request there and the
manual sizing stays the only thing that covers the panel.

GTK_THEME=Adwaita:dark goes with it as the belt to that pair of braces: the
frame takes its colours from the system theme, and the appliance's default is
the light one. If any native chrome does show up, it shows up dark on a black
UI instead of light.

Not verified on the device — the fullscreen half is reasoned from the wire
traces, not seen. The dark theme is what keeps a mistake cheap.

Co-Authored-By: Claude Opus 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

44-x-y api-review/requested 🗳 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.

5 participants