Age | Commit message (Collapse) | Author |
|
Proper handling of client disconnect mean that we no longer need
deathsig handling.
|
|
We will not get a socket hangup if we have duplicates socket fds in the
parent or child, so make sure we clean this up properly after fork.
|
|
This both simplifies our code and fixes an exec fd leak when using
builtin or noop backends.
|
|
When device open or close messages are sent to seatd, libseat must read
messages from the socket until it sees the associated response message.
This means that it may drain enable/disable seat events from the socket,
queueing them internally for deferred processing.
As the socket is drained, the caller will not wake from a poll and have
no reason to dispatch libseat. To ensure that these messages would not
be left in the queue, 6fa82930d0c5660eea3102989c765dc864514e36 made it
so that open/close calls would execute all queued events just before
returning.
Unfortunately, this had the side-effect of having events fire from the
stack of libseat_open_device or libseat_close_device, which we now see
cause problems in compositors. Specifically, an issue has been observed
where libinput end up calling libseat_close_device, which in turn
dispatch a disable seat event that calls libinput_suspend. libinput does
not like this.
Instead, remove the execution from libseat_open_device and
libseat_close_device, and instead make a "ping" request to seatd if
events have been queued. The response to this will wake us up and ensure
that dispatch is called.
|
|
This was regressed by 166feaea3394e00af14418e074ae090e31922f33 which
missed the builtin backend when changing struct libseat_seat_listener to
being passed around as const.
|
|
This reverts commit 1ae6c3b3ddf0ce2a2e1817eb9c74e0c03153df58.
A user might want to run the builtin server as non root, if they have
permission to use the devices.
The check was originally copied from wlroots's direct backend. It was reverted
in fa05d3cde68d with a detailed explanation of why root priviledges are not
always necessary to use the DRM device.
|
|
libseat will never write to that struct. Let's allow callers to
make it read-only.
|
|
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.
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|