-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Closed
Labels
Description
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a feature request that matches the one I want to file, without success.
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 |
---|---|---|
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:
electron/shell/browser/api/electron_api_browser_window.cc
Lines 58 to 64 in 9ffffdb
} 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
alan-m-shen, blueset, JellyBrick and Poopooracoocoo