https://kotlinlang.org logo
Title
m

miguelsesma

06/03/2022, 2:18 PM
I'm trying to make
example-cef-compose
work. I have fixed most things but I'm still stuck in a problem with skiko-awt HardwareLayer, that is used to render the browser. The problem is that that class is internal, so the code has no access to it. Any solution for that?
internal open class HardwareLayer(
    externalAccessibleFactory: ((Component) -> Accessible)? = null
) : Canvas() {
👀 1
t

Thomas

06/03/2022, 3:06 PM
Try this?
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
m

miguelsesma

06/03/2022, 3:27 PM
Thanks. That fixes the import, but I can't still declare variables of that type
t

Thomas

06/03/2022, 3:43 PM
Oh looks like that is caused by CefBrowserWrapper being public
Not sure how to fix that. Can you make it internal maybe?
I think that the issue is that you are exposing the internal type to other files/modules or so.
x

xiaobailong24

06/05/2022, 1:29 PM
Hello, I am interested in compose cef, but official sample is outdated, can you share your code with all fixes?
d

David W

06/05/2022, 8:59 PM
I'm using jcef and it breaks frequently but technically works. Code is here. https://github.com/davidwhitman/SMOL/blob/dev/App/main/kotlin/smol/app/browser/chromium/CefBrowserPanel.kt
I am not willing to handhold anyone through adding it to their own project. There are too many variables, it'd take more time than I'm willing to give, and really this is something jetbrains should do (have proper WebView support in the framework).
x

xiaobailong24

06/06/2022, 3:43 AM
Thanks for your sharing code.
m

miguelsesma

06/06/2022, 7:38 AM
I have made CEF working as @David W suggests, using SwingPanel, but I need to show a compose overlay over it and that can only be done using ComposePanel that has a bug about the background not being transparent 😞 12:36
That is why I'm returning to this approach that seems more promising. I will try to make it work today and share my code,.
@Thomas Making
CefBrowserWrapper
internal did the trick. Thanks. Now I can run the sample. Still have issue with the browser initialisation, but this is a huge step forward.
getHardwareLayer
in
BrowserView
is returning null, it does not find a hardware layer .component. Investigating.