Age | Commit message (Collapse) | Author |
|
This condition was accidentally botched as part of
5923e0edc9bb157cf6398b63d51cc3c0aaf06001
|
|
This name never made much sense. dispatch_and_execute is more
meaningful, especially when compared to the non-executing dispatch
function.
|
|
This handler returns the number of dispatched or executed events, or -1
if dispatch_pending failed.
This helper is used to clean up dispatch_background, which now ensures
that all events are executed before we read or poll the connection, and
have improved error handling in the corner case where the second
dispatch_pending failed.
|
|
Dispatch needs to report if something has happened, which includes
events executed from the queue as these could have lead to additional
dispatch and queuing.
|
|
The socket is expected not to be found if seatd is not running.
In general other backends will be attempted after seatd. There is
already an error message in case no backend can be started.
|
|
clang-format wants to put the terminating NULLs on the same line as the
noop backend when it doens't have any immediate non-NULL neighbors.
Add a newline to stop it.
|
|
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.
|
|
|
|
|
|
This is not strictly speaking necessary as detaching from the bus should
trigger this automatically, but elogind apparently has issues with this.
Doing this explicitly does no harm, so let's just do that.
|
|
Upstream says compositors should wait for DRM nodes using udev instead.
|
|
It currently returned -1 on failure and 1 on success. The API is
intended to return -1 on failure and 0 on success, so fix that.
|
|
The most common pain point I've seen with people trying out seat is
forgetting to add themselves to whatever group the distro has chosen
to own the socket.
Logging this error and path of the socket should make it easier to tell
why things aren't working.
|
|
|
|
|
|
|
|
|
|
|
|
FreeBSD and Linux have different preferred socket locations. Expose an
option to set the location, and implement simple auto-logic for
linux/freebsd.
|
|
If a background event was queued during call dispatch, and no unread
data was left on the socket, there would be no incentive for the user to
call dispatch, and as a result, the events would never be executed.
Execute events at the end of IPC calls that read from the socket to
avoid stalls.
|
|
Dispatch on IPC call only dispatched until the first message was
successfully processed. This could lead to premature dispatch
termination if a background event was received during an IPC call.
Instead, continue dispatching until a non-bg opcode is reported or an
error is received.
|
|
The connection buffer position was erroneously rewinded before reading
the protocol message when the message was a SERVER_ERROR.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Store if an error has occurred and return -1 with ENOTCONN from all
future calls, avoiding attempts to use a broken connection.
|
|
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.
|
|
|
|
|
|
|
|
|
|
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).
|
|
This will be replaced with a libseat API to set the log level.
|
|
This is preparatory work for exposing a public function to set libseat's
log handler.
|
|
The logind code is based on the wlroots implementation, which in turn
contained copy-paste code from Mutter that serves no purpose here.
|
|
|
|
|
|
|
|
|
|
Error handling was broken in close_device, always returning -1.
Use the return value, and add a few errno assignments while we're at it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|