java-cef icon indicating copy to clipboard operation
java-cef copied to clipboard

CefSettings.background_color has no effect

Open magreenblatt opened this issue 5 years ago • 0 comments

Original report by Anton Tarasov (Bitbucket: Anton Tarasov).


When I set a background color like (red):
settings.background_color = settings.new ColorType(255, 255, 0, 0);

And then create windowed opaque browser:
client.createBrowser("about:blank", false, false);

It always appears with white background.
On macOS it takes some time before a web page loads, so the white background can contrast with dark UI…

The reason is that the color is overridden in CefBrowser_N.create:
if (transparent == JNI_FALSE) {
// Specify an opaque background color (white) to disable transparency.
settings.background_color = CefColorSetARGB(255, 255, 255, 255);
}

magreenblatt avatar Jan 22 '20 16:01 magreenblatt