Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WPF/OffScreen require setting windowless_rendering_enabled in 67+ #2431

Closed
amaitland opened this issue Jun 26, 2018 · 7 comments
Closed

WPF/OffScreen require setting windowless_rendering_enabled in 67+ #2431

amaitland opened this issue Jun 26, 2018 · 7 comments

Comments

@amaitland
Copy link
Member

See http://magpcss.org/ceforum/viewtopic.php?f=6&t=16077

To-do update with more details later. Just adding as placeholder

@joaompneves
Copy link
Contributor

joaompneves commented Jul 24, 2018

Probably this should be set as true by default on CefSettings?
I upgraded to the latest version and got a blank screen, because I'm doing Cef initialization with custom settings. I spent a couple of hours looking (debugging) for the problem and had to go through the list of latest changes until I found this. Setting the default to true would prevent further problems.

@amaitland
Copy link
Member Author

It's not that straightforward or I would have already done it. Have a think about the problem further, open to suggestions.

@bddckr
Copy link

bddckr commented Jul 25, 2018

Isn't this already handled by the browser class trying to do it in its constructor?

if (!Cef.IsInitialized)
{
var settings = new CefSettings();
settings.WindowlessRenderingEnabled = true;
if (!Cef.Initialize(settings))
{
throw new InvalidOperationException("Cef::Initialize() failed");
}
}

This obviously fails if CEF is already initialized. How about throwing an exception from now on when CEF is initialized but the flag not being set to true (in this constructor that is)?
That would take care of blowing up in my face early, rather than me overlooking this in any changelog etc.

@amaitland
Copy link
Member Author

@amaitland
Copy link
Member Author

Short term solution throwing an exception maybe ok, long term I'm thinking this is going to need quite a bit more work. It's becoming more common that custom command line arguments are required, #2408 is another example.

  1. Make CefSettings constructor private and create some static methods, e.g. CefSettings.ForWpf() that load the custom values required for WPF. The documentation would need to be updated in a few places for this to work.
  2. Change Cef.Initialize to take an abstract instance of CefSettings (would need to be renamed e.g. AbstractCefSettings) and create C# instances of CefSettings in each of the three namespaces, this would require one additional using statement in some cases, documentation would be largely unchanged.

Will probably go with option 2, won't know how exactly it's going to play out until it's implemented.

@amaitland
Copy link
Member Author

Issue #2477 implements Option 2, so WindowlessRenderingEnabled will be set accordingly.

This is a minor breaking change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants