Developing a wayland compositor on FreeBSD

Greg V greg at unrelenting.technology
Sat Jun 8 01:26:41 UTC 2019


On June 7, 2019 11:44:29 PM GMT+03:00, raichoo <raichoo at acmelabs.space> wrote:
>On Fri, Jun 07, 2019 at 01:28:15PM -0700, Johannes Lundberg wrote:
>> Hi
>> 
>> I'm using the following setup. Maybe some of it helps.
>> 
>
>Thanks a lot :). I also found out why libinput did not register any
>mouse
>events. I simply did not have `moused` running. Reading the OS code
>helps when
>in doubt ^^. Getting close to a usable wayland setup here :D

Hi,

you need moused because by default, the kern.evdev.rcpt_mask is set to only output events from the virtual/multiplexed keyboard/mouse devices. If you set it to 12, that will let events from the actual devices through. (You also need options EVDEV_SUPPORT in kernel – that's default in 12-STABLE & 13-CURRENT, but not in any -RELEASE yet.)

Re: setuid, dev/input permissions, ways of getting input devices.

The more proper way to do it is to use a session management daemon – namely, ConsoleKit2, as we don't have systemd-logind :)

This requires a patched ck2 – I posted that on phab as a port patch and as a GitHub upstream PR. But upstream is inactive, so I guess I'll need to fork it as ConsoleKit3, or ConsoleKit69 or whatever.

This also requires your compositor to support CK2 API. wlroots upstream doesn't want to merge my patch because they hate libdbus and most DBus client libraries that are not systemd's sd-bus. So for wlroots you'll need my patch for CK2 support, search the GitHub PRs for 'consolekit2'. I also have this support in my abandoned Weston fork. By the way, KDE Plasma KWin has supported CK2 out of the box for a long time, I even managed to launch it (with some patches) but it didn't get input devices (needs more fixing).

This *also* for now requires a patched libudev-devd, so that it would pick up device metadata from sysctls (which were added by me to the kernel) instead of opening /dev/input/*, which should not be allowed as a normal user. (On Linux, this metadata is provided by, well, the actual udev daemon.) But the libudev-devd patch has landed and hopefully soon ports will be updated, if it's not already done.

With all that, it is possible to run a compositor as a normal user without setuid root and without /dev/input permissions!

Re: compositor development. I'm building a "DE" on top of Wayfire, which is an awesome compositor with wobbly windows and desktop cubes, like in the good old days. Wayfire also has a plug-in system, like Weston's. You could try implementing tiling stuff as plugins. You can join our chat on freenode #wayfire.


More information about the freebsd-x11 mailing list