Skip to content

helium/linux/native-frame-materials: implement with wayland blur - #461

Open
dumbmoron wants to merge 1 commit into
mainfrom
ntm
Open

dumbmoron wants to merge 1 commit into
mainfrom
ntm

Conversation

@dumbmoron

@dumbmoron dumbmoron commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

the compositor blurs behind the frame through ext-background-effect-v1, or kde's blur protocol on older kwin. the frame paints the material tint on top, and the active tab and location bar get a light veil since there is no vibrant material underneath. compositors without blur support and x11 keep the regular frame.

vts_hover_dark.mp4

Related: #325

@dumbmoron
dumbmoron force-pushed the ntm branch 2 times, most recently from a45005f to fc8ec41 Compare November 20, 2026 10:27
@dumbmoron
dumbmoron marked this pull request as ready for review November 20, 2026 13:03
@dumbmoron
dumbmoron requested a review from wukko November 20, 2026 13:03
@greptile-apps

greptile-apps Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

RetriggerView in Greptile

[Medium impact] The change reaches browser frame rendering on Linux Wayland systems with a supported compositor.

The PR appears safe to merge, with a non-blocking improvement needed for changes in compositor blur support.

Reviews (1) · Last reviewed commit: "helium/linux/native-frame-materials: imp..." · Reviewed by Greptile

@helium-gardener

Copy link
Copy Markdown

Possibly related issues

These relationships were inferred from the effective change and may need maintainer confirmation:

  • Related: imputnet/helium#325 — The PR implements the requested translucent browser frame on Linux when the Wayland compositor offers blur. The feature request covers browser translucency more broadly.
  • Related: imputnet/helium-linux#444 — The opt-in material changes the backdrop behind the caption buttons for the reported dark-frame, light-toolbar theme combination. The opaque frame still uses the existing caption-button color selection.

@helium-gardener helium-gardener Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed. 1 finding(s) were already covered by other reviewers; 5 new finding(s) remain.

Review walkthrough

Changes

Files Summary
patches/helium/linux/add-wayland-background-blur.patch
patches/series
Binds ext-background-effect-v1 and the legacy KDE blur protocol, exposes compositor support through Ozone, and submits blur regions with surface commits.
patches/helium/linux/native-frame-materials.patch
helium/patches/helium/ui/native-frame-materials.patch
Enables the experimental material on blur-capable Wayland compositors. The Linux frame paints a shared theme tint, and the shared UI applies translucent tab and address-bar surfaces and reflects page content under the floating vertical strip.
helium-chromium
patches/helium/linux/add-middle-click-paste-flag.patch
helium/patches/helium/ui/hide-page-actions-flag.patch
helium/patches/helium/ui/compact-debugger-warning.patch
helium/patches/helium/ui/progress-bar.patch
Advances the shared Helium checkout at the same Chromium version and adjusts patch context for the flag entries and address-bar overlays.
helium/patches/helium/core/component-updates.patch
helium/patches/helium/core/noise/canvas.patch
helium/patches/helium/ui/page-zoom-indicator.patch
helium/devutils/update_platform_patches.py
Allows PKI Metadata and SSL Error Assistant updates, takes neighboring pixels into account for cropped canvas noising, gives the text-only zoom indicator a minimum width, and makes patch unmerging overwrite destination files consistently.

Review checks

Check Result Notes
Scope ✅ Passed The full shared tracked-file diff contains eight changes at the same Chromium pin. Linux still downloads the shared and platform archives before applying the shared and platform patch stacks in order.
Project Policy ✅ Passed The changed patch hunks target production source and build rules. The separate Python change is Helium-owned patch maintenance tooling.
Correctness And Safety ⚠️ Finding The materialized code leaves open windows stale after capability changes, loses thin blur-region strips during scaling, and can render light inactive tab labels over a light tint.
Chromium Idioms ⚠️ Finding The two Linux targets that include the shared material header need GN dependencies of their own.
Simplicity And Decomposition ⚠️ Finding The docked vertical strip retains invisible page mirrors, and cropped canvas noising repeats the primary readback.
Patch Organization ✅ Passed The Wayland protocol patch precedes its browser-frame consumer. The recorded fuzz comes from stale context, and both intended Linux material overrides are present in the materialized tree.

Analysis record

  • Changed files considered: 5
  • Findings: 5 new, 1 retained, 0 resolved
  • Already covered by other reviewers: 1
    • wayland.background-blur-manager.capability-refresh — greptile-apps
  • Source snapshot: 9823b6daad00
  • Codex: gpt-6.2-sol, reasoning max, fast mode on, web search cached
  • Patch application: 1 warning(s)
  • Chromium context tool calls: none
  • Maintainer conventions applied: preserve-incremental-loading, preserve-privacy-boundaries, script-resource-lifecycle, stop-work-after-failure, ui-command-contexts, validate-supported-ui-paths, verify-current-revision, verify-runtime-selection-paths, visible-ui-anchors

Limitations

  • Build and runtime behavior were assessed by static inspection.
  • The PR demo video was unavailable. The five supplied screenshots show the separate rounded-content-frame request in imputnet/helium#1494.

}

+// Converts |rrect| in DIP to pixel rects that follow its rounded corners.
+std::vector<gfx::Rect> GetRoundedRectRegion(const SkRRect& rrect, float scale) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium: Preserve the rounded blur region at display scales above 100%

GetRoundedRectRegion() rasterizes the frame in physical pixels, which produces thin horizontal strips near the rounded top corners. Wayland then rounds each strip inward independently when converting it to surface coordinates. At 200% scale, a one-pixel-high strip becomes empty, leaving unblurred bands across the translucent title area. Convert the whole shape to surface coordinates before splitting it into integer rectangles.

Evidence: chrome/browser/ui/views/frame/browser_desktop_window_tree_host_linux.cc:71 scales the rounded shape before iterating its SkRegion. ui/ozone/platform/wayland/host/wayland_surface.cc:374 passes those rectangles to CreateAndAddRegion(), which uses gfx::ScaleToEnclosedRect() at line 437. ui/gfx/geometry/rect.h:332 rounds the top up and bottom down.

+ if (helium::ShouldUseNativeFrameMaterials(GetBrowserView())) {
+ cc::PaintFlags flags;
+ flags.setAntiAlias(true);
+ flags.setColor(helium::GetNativeFrameMaterialTintColor(this));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium: Preserve inactive tab contrast when tinting the Linux frame

A theme can specify a dark frame, a light toolbar, and light inactive-tab text. The new Linux painter uses the toolbar to pick a light tint, while idle inactive tabs show that tint directly and retain their light text. Apply a contrast check to the frame tint, as the shared code already does for the floating strip, or derive the tab foreground from the material behind it.

Evidence: chrome/browser/ui/views/frame/browser_frame_view_linux.cc:87 paints GetNativeFrameMaterialTintColor(this). chrome/browser/ui/views/helium/native_frame_materials.cc:121 derives that tint from kColorToolbar, and line 160 guards contrast only for floating surfaces. chrome/browser/ui/views/tabs/common/horizontal_tab_style_views.cc:664 suppresses idle inactive-tab fills. chrome/browser/themes/browser_theme_pack.cc:256 maps tab_background_text to the foreground used by TabStyle::GetTabForegroundColor().

":browser_frame_view_linux_native",
":browser_native_widget_aura_linux",
":picture_in_picture_browser_frame_view_linux",
+ "//chrome/browser/ui/views/helium:native_frame_materials",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium: Declare the native-material dependency in both Linux frame targets

browser_desktop_window_tree_host_linux.cc and browser_frame_view_linux.cc now include native_frame_materials.h, but the new GN dependency belongs to the factory target alone. GN's include checker rejects both includes because their compiling targets have no dependency path that exposes the header. Add //chrome/browser/ui/views/helium:native_frame_materials to browser_desktop_window_tree_host_linux_impl and browser_frame_view_linux.

Evidence: chrome/browser/ui/views/frame/BUILD.gn:2632 and chrome/browser/ui/views/frame/BUILD.gn:2664 own the new includes. The dependency at chrome/browser/ui/views/frame/BUILD.gn:2876 is private to browser_frame_view_factory_views. The other consumers of :native_frame_materials also list it in private deps.

+ // takes ext-background-effect-v1 or KDE's blur protocol.
+ return ui::OzonePlatform::GetInstance()
+ ->GetPlatformRuntimeProperties()
+ .supports_background_blur;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium: Release page mirrors while the vertical tab strip is docked

With native materials enabled, a collapsed vertical tab strip attaches two mirrors of the adjacent page even while docked. The fade makes both mirrors invisible, but their lifetime still forces Chromium to create a separate render surface for the page subtree during ordinary content updates. Attach the mirrors when hover expansion starts and release them when the collapse fade finishes.

Evidence: The Linux capability gate activates the shared code in helium/patches/helium/ui/native-frame-materials.patch:743, which supplies the contents even for FloatingStyle::kNone. chrome/browser/ui/views/helium/contents_reflection.cc:154 makes the fade zero while docked, while lines 181 and 197 create the mirrors. cc/layers/mirror_layer.cc:48 increments the source layer's mirror count, which forces a render surface in cc/trees/property_tree_builder.cc:424.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Wrong for Linux: without a vibrant material, the contents are only mirrored while the strip floats. It is true on macOS. Since the new floating tab strip flag is off by default, it now only happens when that flag is on.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Agreed that this is an opt-in case. In the reviewed Linux revision, GetNativeFrameMaterialFloatingColor() can still return a tint without a vibrant material, and UpdateNativeFrameMaterialBackground() passes the page to SetContents() even at FloatingStyle::kNone. The fade hides both mirrors, but they stay attached and force a separate render surface while the strip is docked.

Comment thread helium-chromium Resolved
the compositor blurs behind the frame through ext-background-effect-v1,
or kde's blur protocol on older kwin. the frame paints the material
tint on top, and the active tab and location bar get a light veil since
there is no vibrant material underneath.

Related: #325
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant