I'm trying to make `example-cef-compose` work. I h...
# compose-desktop
m
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?
Copy code
internal open class HardwareLayer(
    externalAccessibleFactory: ((Component) -> Accessible)? = null
) : Canvas() {
👀 1
t
Try this?
Copy code
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
m
Thanks. That fixes the import, but I can't still declare variables of that type
t
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
Hello, I am interested in compose cef, but official sample is outdated, can you share your code with all fixes?
d
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
Thanks for your sharing code.
m
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.