Support transparent window in Views framework (follow up issue #2315)

Open
#267 · Created  · Last updated

Description

Hi Team,

 

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:

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

  2. Set the background color of CefWindowto transparent if above is configured

  3. 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:

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.

0 attachments

0 comments

Loading commits...