Support Wayland
I suppose we might be able to just build both X11 and Wayland GLFW into a single build for all linux.
An attempt to support Wayland has been made over at https://github.com/PixelGuys/Cubyz-libs/pull/4. After some discussion, we have agreed that a different approach than that which was taken by that PR was needed. I'd like to suggest discussing this here.
So far, we have looked at these options:
- ~~Using a custom build script, compile wayland-scanner and use then invoke it to generate code. Use that to build GLFW with wayland support. Vendor required xkbcommon headers.~~
- This is the approach the PR took and it was deemed to be too much code.
- Use some upstream Zig library that packages GLFW.
- This introduces an extra dependency.
- Use wayland-scanner from the system. This would require it to be installed in a future CI system, and for anyone who wants to manually build Cubyz-libs. We would still have to come up with a solution for how we handle xkbcommon headers.
- Any other ideas?
We would still have to come up with a solution for how we handle xkbcommon headers.
Can we not also use the ones installed on the CI system?
https://codeberg.org/ifreund/zig-xkbcommon https://codeberg.org/ifreund/zig-wayland
I am aware of these projects, but Quantum previously stated on the PR linked above regarding this:
I'm not really sold on this approach though, since it does mean adding another middleman which could be a security vulnerability.
So I'm not certain if it would be preferred to use libraries like these or "reimplement" them instead. My approach was essentially the latter on my previous PR, but that ended up adding too much unwanted bloat to the repository, so I'm not entirely sure how to approach this.
Then make a hard-fork, they look simple enough to do that. The problem is Zig - someone's gotta maintain it before 1.0 release, it's not just drop & forget - same goes for anything we can come up with.
wayland does work though, I'm using KDE Plasma in wayland and it works like a charm.