Page 1 of 1

Issue getting transparent browser background

PostPosted: Mon Jan 23, 2017 5:11 am
by mikaeljohansson2
Hi!

We’re trying to create an application based on CEF. But we have problems with making the webpages running in the browser transparent. Our app (based on cefsimple) is transparent in Linux using xfwm4. But when we load a web page it seems like CEF/Chromium is creating one or two Windows/layers in the background that is opaque (white).

We put a lot of debug prints all over the CEF/Chromium code in order to track how the layers are painted - with no success. Can you please advise us where to modify in order to get transparent backgrounds?

By modyfing the Skia color definitions we could see that it is possible for CEF to be transparent, but that is of course not a way to go.

We have of course set the web page to have transparent background.

Best regards Mikael

See attached image.
cef_transparent.png
cef_transparent.png (24.73 KiB) Viewed 7979 times

Re: Issue getting transparent browser background

PostPosted: Mon Jan 23, 2017 11:46 am
by magreenblatt
As you've noticed there is no easy way to achieve transparency with windowed rendering. You can instead use off-screen rendering which provides a bitmap containing an alpha channel.

Re: Issue getting transparent browser background

PostPosted: Mon May 08, 2017 4:29 am
by mikaeljohansson2
Thank you! That solved my issue.

Re: Issue getting transparent browser background

PostPosted: Thu Mar 22, 2018 10:52 am
by Czarek
Transparent windows seem to be working now on Linux in windowed mode with latest CEF.

Re: Issue getting transparent browser background

PostPosted: Tue Sep 08, 2020 7:09 am
by yosoymin
I've found a way this is possible using views framework and a simple modification in CEF code. This is working in Windows and Linux. More info in this thread: viewtopic.php?f=8&t=17421