lvsti / CEF.swift

Swift bindings for the Chromium Embedded Framework
BSD 3-Clause "New" or "Revised" License
94 stars 29 forks source link

Crashes when trying to do offscreen rendering. Plus CEFDemo too #47

Closed knightbenax closed 3 years ago

knightbenax commented 3 years ago

Currently if you try to use windowless rendering, you get a crash at the runMessageLoop() function. The error message isn't quite clear

knightbenax commented 3 years ago

Resolved this. Putting here for anyone from the future. You need to provide the viewRectForBrowser as well as onPaint methods in a custom CEFRenderHandler and you should be good to go

lvsti commented 3 years ago

Can you tell me whether it was a crash in CEF.swift or in CEF itself?

knightbenax commented 3 years ago

It's an error itself with CEF. Turns out if you don't provide the GetViewRect, CEF doesn't know what bounds to draw the off-screen window at.

The CEF docs just didn't say that.