Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Make an option to make BrowserView completely opaque #34329

Closed
3 tasks done
kaizjen opened this issue May 23, 2022 · 2 comments
Closed
3 tasks done

Comments

@kaizjen
Copy link

kaizjen commented May 23, 2022

Preflight Checklist

Problem Description

Currently, when a BrowserView is on top of another BrowserView, the background view still displays its content over the foreground one, given that the FG browserview doesn't have a css-defined background color.

Screenshot of a window with two BVs
The blue is the background color of the foreground BrowserView (set via view.setBackgroundColor()), and the red - of the background view. The text is in the red view, but is displayed over the blue view, because the blue view has the background only set by view.setBackgroundColor() and not css.

Proposed Solution

It would be nice to be able to have a BrowserView.prototype.setOpaque(isOpaque: boolean) function that will tell Electron to render the BrowserView over everything else (respecting its z-position on the window, of course).

An alternative way to solving this is just to render the background color of BrowserView above all the "lower" BrowserViews, covering them. But some people might actually rely on that functionality, so, perhaps, it's not the best solution.

Basically, with view.setOpaque(true), it should look something like this:
Overlapping Browser Views

Alternatives Considered

Of course, the obvious solution is to set the background-color: white, or something non-transparent in the css of the BrowserView (that's how I made the second screenshot), however, BrowserViews are usually used to display external (and unknown) content, and you will either add background-color: white and affect non-transparent pages, or affect transparent pages by doing nothing.

Additional Information

No response

@pushkin-
Copy link

Would this PR address this issue?

@kaizjen
Copy link
Author

kaizjen commented May 23, 2022

Yes, thanks.

I don't know if I should close this now, becuase the PR hasn't appeared in a normal release yet.

@kaizjen kaizjen closed this as completed May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants