The drm-kmod drivers use linuxkpi and end up with /dev/drm being the
canonical path for the devices, but the drm-subtree drivers use drmkpi
which has them appear under /dev/dri like Linux. Thus, adapt path_is_drm
to recognise both on FreeBSD.
Matching the functionallity by the seatd open call. O_NONBLOCK is
specially important for libseat, otherwise it hangs while trying to
drain all events from an input device fd.
Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
wlroots' libinput backend expects the name of the seat to either match
ID_SEAT from udev, or in case ID_SEAT returns nothing, match seat0. As
noop has no seat switching, always returning seat0 as the session name
fixes that.
Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
Quoting the Meson documentation:
> Note that the value returned for built-in options that end in `dir`
> such as `bindir` and `libdir` is usually a path relative to (and
> inside) the `prefix` but you should not rely on that, as it can also
> be an absolute path [in some cases](Builtin-options.md#universal-options).
> [`install_dir` arguments](Installing.md) handle that as expected
> but if you need an absolute path, e.g. to use in a define etc.,
> you should use the path concatenation operator like this:
> `get_option('prefix') / get_option('localstatedir')`.
> Never manually join paths as if they were strings.
The concatenation of two absolute paths caused seatd-launch in Nixpkgs
to try to launch e.g.
/nix/store/43wyk9s2l2z8cparnshbf24d39vm5272-seatd-0.7.0//nix/store/j9a7k4qqwc3byyfmpqwg46shmh6g82yf-seatd-0.7.0-bin/bin/seatd.
This function is only used for logind, which is Linux-specific, but the
presence in common/drm.c suggested that it had to be portable.
Move it to the logind backend for now.
4ad48cb305 introduced support for NetBSD,
which modified a number of our ifdefs. In that process, FreeBSD was
accidentally excluded from an important code path that controls keyboard
usage on the kernel console.
Revert part of that change to restore FreeBSD behavior.
Configurable socket paths exist mainly to facilitate multiple parallel
seatd instances. However, the only valid use-case for running multiple
instances of seatd is testing during development, which can just as well
be done by changing SEATD_DEFAULTPATH at compile-time for test builds.
Remove the command-line argument in seatd for runtime configuration of
socket path, hardcode the socket path in seatd-launch, and change seatd
unlink/chmod/chown code to not run when started by seatd-launch.
This means that seatd-launch will now fail to start seatd if another
seatd instance is already running. The unlink code still runs when seatd
is started normally to assist in system crash recovery, but this may be
removed later if we deem it unnecessary.
SEATD_LOGLEVEL was used to set the loglevel despite already having
getopt in place. Remove the environment variable and make a command-line
argument for it instead.
This should not need to be configured, so remove the argument. If
downstream prefers a different folder, the location can be made
compile-time configurable like for seatd itself.
SOCK_PATH is made redundant by the -s command-line argument added in
a98e0c4ce9. Support was originally left
behind for short-term compatibility, but it should be fine to remove.
Previous socket cleanup is changed to run unconditionally. The cleanup
now fails if the existing file is not a socket.
sd_bus_call_method may have read and queued our ping response, so we
cannot assume that a previous ping will make the socket readable.
Instead, always send a ping if read or write queues are not empty, even
if a ping has already been sent.
This allows downstream users to write:
dependency('libseat', fallback: 'seatd')
instead of having to rely on the seatd/meson.build's variable name:
dependency('libseat', fallback: ['seatd', 'libseat'])
This reduces the boilerplate a bit. Use logind.name() instead of
having a separate source of truth. Requires adapting the checks a
bit because the dep name has a "lib" prefix.