https://kotlinlang.org logo
#compose-desktop
Title
# compose-desktop
a

alexandre mommers

03/02/2024, 6:30 PM
Hello, is there any way to get the native window (NSWindow, X11Window, HWND ...) from a compose desktop app ? I'm working on a Webgpu binding, and that work fine with SDL2, but using it with compose could be really interessting.
🙌 1
a

Alexander Maryanovsky

03/03/2024, 4:13 PM
It’s more a question about Java/AWT
a

alexandre mommers

03/03/2024, 11:04 PM
Compose use JFrame under the hood ? there is no window management here ?
a

Alexander Maryanovsky

03/03/2024, 11:10 PM
Not sure what you mean by “window management”. There is some special handling, but yes, it’s a JFrame. When you show a Window, you get a
FrameWindowScope
in which there’s a
window: ComposeWindow
property, and
ComposeWindow
subclasses
JFrame
.
a

alexandre mommers

03/03/2024, 11:17 PM
Correct me if I'm wrong, but Compose seems to be using Skia. If I consider a platform I'm familiar with, say macOS, how does Skia access native components like NSWindow or CAMetalLayer to use the GPU API ?
a

Alexander Maryanovsky

03/03/2024, 11:18 PM
I’m not too familiar with that part, but you can find it here: https://github.com/JetBrains/skiko
a

alexandre mommers

03/03/2024, 11:18 PM
I Will check, thanks 🙂
a

alexandre mommers

03/07/2024, 1:33 AM
I need to try this on Linux and Windows, but it's working on MacOS. Thanks! I'll post the GitHub project when the binding is a little more advanced.
3 Views