Issue getting transparent browser background

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Issue getting transparent browser background

Postby mikaeljohansson2 » Mon Jan 23, 2017 5:11 am

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 7916 times
mikaeljohansson2
Newbie
 
Posts: 5
Joined: Mon Jan 23, 2017 1:39 am

Re: Issue getting transparent browser background

Postby magreenblatt » Mon Jan 23, 2017 11:46 am

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.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Issue getting transparent browser background

Postby mikaeljohansson2 » Mon May 08, 2017 4:29 am

Thank you! That solved my issue.
mikaeljohansson2
Newbie
 
Posts: 5
Joined: Mon Jan 23, 2017 1:39 am

Re: Issue getting transparent browser background

Postby Czarek » Thu Mar 22, 2018 10:52 am

Transparent windows seem to be working now on Linux in windowed mode with latest CEF.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: Issue getting transparent browser background

Postby yosoymin » Tue Sep 08, 2020 7:09 am

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
yosoymin
Techie
 
Posts: 11
Joined: Mon Mar 02, 2020 1:28 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 39 guests