Is it feasible to build desktop app that will run ...
# compose-desktop
m
Is it feasible to build desktop app that will run on Linux distro with Wayland instead of X11?
e
Compose for Desktop uses Swing to handle windowing (and input and other stuff)
Swing doesn't support Wayland. https://wiki.openjdk.org/display/wakefield has been working on it for years but it's not quite there yet
JB has been working on it for other reasons, https://blog.jetbrains.com/platform/2023/08/wayland-support/ so maybe that will come in the future
or potentially Compose for Desktop could switch to something else to manage windows and input. I've heard multiple people have the idea but I don't know if anybody has seriously worked on it
m
Disclaimer : I’m not too deep in desktop development. Can this issue be solved using XWayland? I’ve started with KMP for my use case since I thought it utilizes skiko - skia for kotlin instead of swing as a GUI enigne(library?).
e
Skia only handles rendering, not interacting with the system
thank you color 1
e.g. it can draw to a surface, but something else still has to create a window to hold that surface
thank you color 1
most compositors have XWayland integrated so most X11 apps should mostly work without any wayland knowledge
see the above JB blogpost for some cases where mostall
j
@ephemient I used thank you color here as "ahh, so that's why" 😛
a
I just saw a talk on Project Wakefield. You may be able to use WLToolkit since Compose uses AWT and Swing for window management. Refer around the 20:00 minute mark on the video for a demo. https://fosdem.org/2024/schedule/event/fosdem-2024-2154-openjdk-project-wakefield-the-wayland-desktop-for-jdk-on-linux/
m
Neat, but that still doesn’t mean you can develop native Wayland apps using Compose Multiplatform
e
no but improved support in JBR is good for Kotlin desktop