Window remains white with GPU enabled (macOS)

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.

Window remains white with GPU enabled (macOS)

Postby radar » Thu Nov 30, 2017 3:38 am

Hi,

I stated integrating CEF in a Java project using JNI and c++. The c++ code is originally derived from cefsimple and then extended. The code uses a native macOS window (non-OSR). Can't use java-cef because the project is SWT-based.

When I run the code standalone (i.e. native c++ build and application, without Java), all is fine, GPU compositing, webGL etc. are working as expected.

Now, when I run the same code embedded in my Java application, then the window opens, but remains white. The browser seems "working" though, since behind the "white" surface the content seems to be present, and I can "click" on invisible links, etc. Also, I can see that the GPU process is started. However, no log / error output is generated.

If I use "--disable-gpu", then everything is fine, but of course without webGL, which I would need.

I've seen a comment for java-cef (https://bitbucket.org/chromiumembedded/java-cef/issues/109/linux-mac-fix-discovery-of-icudtldat) which also suggests adding "--disable-gpu".

My suspicion would be some kind of permission / access issue for the shared surface between the browser/render/GPU process when GPU support is enabled, but I can't figure out what goes wrong.

Any pointers? Thanks.
radar
Techie
 
Posts: 12
Joined: Thu Nov 30, 2017 3:16 am

Re: Window remains white with GPU enabled (macOS)

Postby Czarek » Mon Dec 04, 2017 1:29 pm

Are you calling setWantsLayer:YES for the top window?
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: Window remains white with GPU enabled (macOS)

Postby radar » Tue Dec 05, 2017 12:46 pm

Yes, I tried setWantsLayer, but doesn't seem to help. I'm pretty sure it's related to this though, but I can't figure out the difference between the standalone native app, which works, and the java version, which doesn't.
radar
Techie
 
Posts: 12
Joined: Thu Nov 30, 2017 3:16 am

Re: Window remains white with GPU enabled (macOS)

Postby radar » Tue Dec 12, 2017 8:24 am

Just in case someone runs into the same / a similar issue:

--disable-remote-core-animation

helps.

I don't know of any side effects though.
radar
Techie
 
Posts: 12
Joined: Thu Nov 30, 2017 3:16 am

Re: Window remains white with GPU enabled (macOS)

Postby radar » Tue Dec 12, 2017 8:34 am

Yet a better solution:

[[NSUserDefaults standardUserDefaults] registerDefaults:@{
@"NSWindowHostsLayersInWindowServer": @"YES"
}];

Then --disable-remote-core-animation is not required anymore.
radar
Techie
 
Posts: 12
Joined: Thu Nov 30, 2017 3:16 am

Re: Window remains white with GPU enabled (macOS)

Postby Czarek » Tue Dec 12, 2017 11:14 am

@Marshall: is `NSWindowHostsLayersInWindowServer` something that should be executed also in cefclient/cefsimple apps? I am seeing a maybe similar issue in my app when user awakes computer from sleep the CEF window sometimes becomes blank.

Related Chromium references:

1. Topic created by Marshall on chromium-dev group:
https://groups.google.com/a/chromium.or ... discussion

2. Chromium bug "Remove NSWindowHostsLayersInWindowServer workaround":
https://bugs.chromium.org/p/chromium/is ... ?id=626733
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: Window remains white with GPU enabled (macOS)

Postby magreenblatt » Tue Dec 12, 2017 1:07 pm

Sounds like it depends on what SDK version you're building against. Do the problems reproduce when building with the base SDK and Xcode versions specified at https://bitbucket.org/chromiumembedded/ ... uilding.md ?
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Window remains white with GPU enabled (macOS)

Postby Czarek » Tue Dec 12, 2017 1:33 pm

CEF target SDK is 10.9 [1], so looks like this should not be an issue with CEF sample applications.

[1] https://github.com/chromiumembedded/cef ... ke.in#L294
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: Window remains white with GPU enabled (macOS)

Postby Czarek » Tue Dec 12, 2017 2:09 pm

@radar: CEF library runs only on OS X 10.9 or later, so is there a reason you're setting an older target sdk, or is this not the case? In my case I'm using py2app and I haven't set target sdk explicitilly, so it probably links against an older version.
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: Window remains white with GPU enabled (macOS)

Postby radar » Tue Dec 12, 2017 3:04 pm

@czarek: This could explain why it doesn't need NSWindowHostsLayersInWindowServer as standalone but is required when running from Java. The min version / SDK for the various components is:

JAVA (latest JDK 8)
cmd LC_VERSION_MIN_MACOSX
cmdsize 16
version 10.7
sdk 10.8

SWT (4.7)
cmd LC_VERSION_MIN_MACOSX
cmdsize 16
version 10.7
sdk 10.10

CEF Wrapper Code (dynamic library JNI -> CEF *or* standalone command line executable)
cmd LC_VERSION_MIN_MACOSX
cmdsize 16
version 10.13
sdk 10.13

with Java being below 10.9. I'm however not sure how this all adds up when the different images (Java + SWT + JNI CEF Wrapper Code) are loaded together.
radar
Techie
 
Posts: 12
Joined: Thu Nov 30, 2017 3:16 am

Next

Return to Support Forum

Who is online

Users browsing this forum: No registered users and 65 guests