~kennylevinsen/seatd

seatd/include d---------
Add no-op session

This is useful for headless testing, for instance with VKMS:

    modprobe vkms
    export WLR_DRM_DEVICES=/dev/dri/card1
    export WLR_BACKENDS=drm
    export LIBSEAT_BACKEND=noop
    sway

We don't need any of the VT handling in this case.
log: Include debug logs in release builds
log: Remove function name from log
libseat: Fix typo in doc string
seatd: Tear down VT when disabled client closes

If a client closed while it was disabled, the VT would not be torn down.
If the user navigated back to the VT it belonged to, they would be
stuck.

When a client is disabled, open the fd for the VT it belonged to and
perform regular teardown on it.
client: Replace pending_disable with state enum

This simplifies logic in seat handling.
terminal: Ack both release and acquire

Linux only requires acking release and ignores ack of acquire, but
FreeBSD is more stringent and will patiently wait for both to be acked.

Implement proper acking for both events.
seat: Rework seat activation/switch logic

The seat activation logic did not correctly handle VT switching and
switching between multiple sessions.

Session switching on VT-bound seats is now performed using a VT switch,
taking advantage of VT signals to perform the actual switch. This
simplifies switching logic and makes it more robust.
poller: Raise signals through self-pipe

Signal handling relied on poll(2) being interrupted by signals, followed
by a check for signal handlers flagging a signal as received. This only
allowed signals that were received during poll(2) to be handled
correctly.

Implement the usual self-pipe implementation, where signal handlers
write an arbitrary byte to a polled file descriptor to ensure proper
level-triggered signal handling.
client: Do not leak idle clients on exit
test: Add test_run and test_assert macros

test_run and test_assert replaces regular assert with better logging
which include the currently running test name. The tests can now also be
built without DEBUG.
Remove unused list implementation
poller: Convert to linked_list
server: Convert seat list to linked_list
poller: Make event sources opaque
seatd: Remove unused device_closed msg body
linked_list: Implement linked_list_take
seat: Destroy all clients on teardown
protocol: Add note to remove device_closed msg

The content of this message is unused, so it should be converted to a
content-less message.
libseat: Improve logging with seatd conn helpers

Add helpers around connection access to have all logging centralized and
reduce code duplication. Improve existing helpers to further reduce code
duplication.

The seatd backend should have much better logging after this.
Introduce libseat_set_log_level

The default level is SILENT. log_init no longer takes an initial log
level (so that calls to libseat_set_log_level prior to log_init work
correctly).
Next