Thank you very much for checking it out! I was afraid no one will take a look because it‘s not that particularly interesting on the surface.

Regarding verbosity, the foreign function&memory interface is deliberately very low-level, they only want to expose a safe and performant interface on which further, more handy abstractions can be built, which is imo the correct decision here.

I sort of started to build such a “lib” in an ad hoc way (see the CWrapper class) for error handling in particular. Type safety would be another point, but that is also not yet a concern on this level for this JDK project.

Thanks for the feedback, I will document it better and get back at you! Unfortunately the linux user space is criminally under-documented so I would also have trouble clearly explaining some of the concepts/libs I actually make use of, I had to read lots of code from wlroots/weston to make it work. So, do not quote me on the following description!

Libseat in particular is responsible for seat- and session-management, where a seat is either a physical access to a computer, or a remote one (e.g. an active ssh connection would be another seat). Usually there is a single physical seat, and it can have multiple sessions attached to it, which happens when you log into a vtty, or start up a display manager. You can query these through the `loginctl` utility (I think it is part of systemd).

Maybe the most relevant part of this interface is that connected devices’ events (mouse, keyboard, etc) under /dev/input are only queryable by root, and one shouldn’t really be running their DE with sudo and such. In the old times this was solved by the xserver actually having elevated permissions, and WMs only communicating with that through an unprivileged protocol, but non-root xserver has been possible for years now, plus wayland compositors (as is this project) also run as a simple, unprivileged programs. This is possible by opening these “event files” through libseat basically, which will give access to these files when the given executable is the active session, and revoke access when one changes to another session. E.g. when you press ctrl+alt+FN your DEs input devices’ accesses will get revoked and be given to the virtual terminal, and vice versa. (Actually, I failed to find any way to query for the currently active session, apparently it is only possible through dbus which I didn’t want to depend on for this project, so I make use of loginctl in a quite hacky way..).

Regarding the DRM part it currently only supports “primitive buffers” which are supported by any video card (and are the replacement for the previous fbdev interfaces if I’m not mistaken, so on a modern kernel this is the way your boot logs are already being displayed), but digging a little bit more into the DRM lib could give one an OpenGL context and Skia can make use of them, so it would be a relatively small undertaking, but I wanted to get an interactive demo before that.

Actually, I want(ed) to make a whole toy wayland compositor out of this, even reimplementing libwayland’s server side so that I could test a new virtual thread per application model with Loom (not sure if it would be any better though), but one step at a time (plus I have plenty other side project ideas :D ).