Skip to content

[Feature Request]: Support full frame transparency with Mica background material #38532

@samuelmaddock

Description

@samuelmaddock

Preflight Checklist

Problem Description

The Mica backgroundMaterial effect does not appear below the WebContents.

Proposed Solution

The backgroundMaterial option should behave the same as when setting the vibrancy option.

macOS: vibrancy: 'medium-light' Windows: backgroundMaterial: 'acrylic' Windows: backgroundMaterial: 'acrylic' + transparent: true
Screenshot 2023-05-31 at 4 30 04 PM image (5) image (6)

When vibrancy is set, the WebContents is transparent by default. The same should apply to backgroundMaterial. Setting transparent: true doesn't seem to be a valid workaround, but ideally should still work.

The code below needs to be updated:

} else if (!vibrancy_type.empty() || transparent) {
// If the BrowserWindow is transparent or a vibrancy type has been set,
// also propagate transparency to the WebContents unless a separate
// backgroundColor has been set.
web_preferences.SetHidden(options::kBackgroundColor,
ToRGBAHex(SK_ColorTRANSPARENT));
}

Alternatives Considered

None.

Additional Information

Tested on:

Edition	Windows 11 Pro
Version	22H2
OS build	22621.1778

Fiddle gist: https://gist.github.com/34cf667b21a5075d1f6fbe093d7ad7f9

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions