Developing a wayland compositor on FreeBSD

Johannes Lundberg johalun0 at gmail.com
Fri Jun 7 20:28:20 UTC 2019


On 6/7/19 10:10 AM, Pete Wright wrote:
>
>
> On 6/7/19 9:50 AM, raichoo wrote:
>> Hi,
>>
>> Roughly 2 weeks ago I started porting my window manager hikari
>> (https://hub.darcs.net/raichoo/hikari) over to wayland. I'm
>> currently running 12-STABLE and I'm making some progress.
>> I occasionally stumble across some weird behavior and I'm
>> not sure if that's related to wayland running on FreeBSD or
>> me just doing something wrong.
>>
>> The first thing that I ran into was that libinput does not seem
>> to be able to find any input devices unless I chmod everything
>> under /dev/input to less strict permissions (777 of course works
>> fine but I didn't test with anything else yet). This also seems
>> to be an issue for `sway` which I've tried out on a test
>> machine running 13-CURRENT.
>>
>> I also seem to have problems getting mouse events on these
>> machines (2 X1 carbons, 3rd and 5th gen). I initially thought
>> it was just me not rendering the cursor correctly but `sway`
>> seems to be affected by the same issues (only there I can see
>> a cursor appear but it's not reacting to any input).
>>
>> Since I'm fairly new to the whole wayland eco system I'm waa
>> wondering if this is a good place to help to improve wayland
>> support on FreeBSD.
> If I'm not mistaken Xorg is a setuid binary, so i can access devices
> under /dev/input without problems.  when i was testing sway a while
> ago i attempted to use a devd ruleset to change thing so that the
> devices were in the "video" group and had appropriate permissions. if
> you are using the drm-kmod you'll already are a member of this group. 
> i don't think i ever got the devd ruleset working to my satisfaction
> as i see a shell script that does this in my ~/bin/ directory that
> does this for me :)
>
> i also remember having issues with mouse and keyboard input using sway
> - these environment variables seemed important:
> export XKB_DEFAULT_RULES="evdev"
> export XKB_DEFAULT_LAYOUT="us,us"
> export
> XKB_DEFAULT_OPTIONS="caps:ctrl_modifier,shift:both_capslock_cancel"
>
> as did setting my XDG_RUNTIME_DIR to something reasonable (in my case
> it was /tmp/xdg-runtime-dir).  i also remember using
> "/usr/local/bin/libinput debug-gui" to help debug this.  i setup my
> init script to spawn a terminal then this program which helped a lot.
>
>
> hope this helps!
>
> -pete
>
Hi

I'm using the following setup. Maybe some of it helps.

# /etc/rc.conf
devfs_system_ruleset="localrules"

# /etc/devfs.rules
[localrules=10]
add path 'input/*' mode 0660 group video

# ~/.cshrc (will differ if you're using a different shell)
setenv XKB_DEFAULT_RULES   evdev
setenv XKB_DEFAULT_LAYOUT  us,us
setenv XKB_DEFAULT_OPTIONS caps:ctrl_modifier,shift:both_capslock_cancel

if ( ! $?XDG_RUNTIME_DIR ) then
    setenv XDG_RUNTIME_DIR /tmp/${uid}-runtime-dir
    if ( ! -d "$XDG_RUNTIME_DIR" ) then
        mkdir "$XDG_RUNTIME_DIR"
        chmod 0700 "$XDG_RUNTIME_DIR"
    endif
endif




More information about the freebsd-x11 mailing list