Age | Commit message (Collapse) | Author |
|
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.
|
|
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 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.
|
|
|
|
errno was not being set by open_seat in most cases, leading to
simpletest possibly failing with "libseat_open_seat() failed: Success".
|
|
Up until now we assumed the session was always active on startup.
This might not be the case. Instead, read the current value of the
Active property.
|
|
sd_bus_call drains received messages into the receive queue, and peeks
for its own return value. It does not dispatch the receive queue.
As the socket is drained, the caller will not wake from a poll and have
no reason to dispatch libseat. This has gone unnoticed largely due to
logind sending an event for every device, making it unlikely that no
unread message will be left on the socket.
Like we have done for seatd, we fix this by sending a "ping" request to
logind if anything is left in our receive queue as reported by
sd_bus_get_events. The response to this will wake us up and ensure that
dispatch is called.
|
|
|
|
libseat will never write to that struct. Let's allow callers to
make it read-only.
|
|
This name never made much sense. dispatch_and_execute is more
meaningful, especially when compared to the non-executing dispatch
function.
|
|
|
|
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 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.
|
|
|
|
|
|
|