Skip to content

Conversation

@cnelson-fp
Copy link

This is a PR of the work by Andy Tzeng:
https://bitbucket.org/chromiumembedded/cef/pull-requests/267/overview

Andy's over is copied below:

What I need is very similar to the issue #2315. I would like to provide my changes for the case.

First of all, the requirement I have is to create a non-rectangular window. One solution is implementing OSR to have parent window with transparent background. Another solution is creating a translucent window via Views frameworks, which is what this PR did.

The major changes are:

Configure opacity to views::Widget::InitParams::WindowOpacity::kTranslucent while initializing the Widget controlled by the alpha component of CefBrowserSettings.background_color

Set the background color of CefWindow to transparent if above is configured

Invoke CefContext::Get()->GetBackgroundColor() with STATE_ENABLED from Views framework invocation chain to enable transparent capability.

I created a testing page using the Views framework as below:
Example preview
The page can be launched by
cefclient --use-views --transparent-painting-enabled --hide-frame --hide-controls --hide-overlays
Thank you for any feedback/comments in advance.

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