summaryrefslogtreecommitdiff
path: root/src/logind-util.c
Commit message (Collapse)AuthorAgeFilesLines
* compositor: Fix a couple of #includes to use "" instead of <>Kristian Høgsberg2014-01-311-1/+0
|
* logind: delay wakeup until DRM-device is resumedDavid Herrmann2013-12-031-21/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The logind API was designed to allow any kind of devices and any number of devices. It has no idea of "main DRM device" or similar. However, the weston DRM backend was designed with a single DRM device as master. Therefore, we wake it up unconditionally on session-wakeup. But this may fail with logind as a session may be awake, but not all devices have been resumed, yet. Therefore, we change the weston-logind backend to deal with this case correctly. Instead of waking up the compositor on session-wakeup, we wait for the main DRM device to wake up. Once we get the event, we notify the compositor. For sleep, we reverse this logic. On *any* of the following events we tell the compositor to go to sleep: - Session gets inactive - DRM device gets inactive - DRM device is removed This guarantees, that weston is only active if *both*, the session and the main DRM device are awake/active. Note that we could actually rely solely on the DRM-device Pause/Resume events from logind and drop all the Active-Prop-Changed handling. logind guarantees proper ordering of both. However, in case we ever change weston to support multiple GPUs, we need the per-device notification. Thus, keep the code. This also makes weston more fail-safe in case logind fails to send the PauseDevice event (for whatever reason..).
* logind: change to -1+errnoDavid Herrmann2013-11-211-6/+10
| | | | | | | | | | Set errno and return -1 in public API calls like all other weston code does. Most systemd+dbus calls return negative error-codes instead of -1 and setting errno. Thus, we need to explicitly set errno before returning. Also note that we must set errno _after_ the cleanup path. Calling functions like close() in the cleanup path might overwrite errno (which is not what we want). So protect errno until the final return -1;
* logind: Use dbus_bool_t for bool types in dbus callsKristian Høgsberg2013-11-211-2/+3
| | | | | | | | The gcc built-in 'bool' type is not the same size as dbus_bool_t, which is an uint32_t. Passing a pointer to bool where dbus expects a uint32_t * doesn't work. Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
* logind: Return proper error value when tty or seat doesn't matchKristian Høgsberg2013-10-301-1/+7
| | | | | | | | If the seat or tty doesn't match we return with r == 0, which looks like success to weston_launcher_connect(), which then fails to fall back to the legacy path. https://bugs.freedesktop.org/show_bug.cgi?id=70876
* launcher: add logind backendDavid Herrmann2013-10-211-0/+913
Instead of connecting to weston-launch from launcher-util, we now try to connect to logind first. If logind provides session-devices, we use them. If not, we fall back to the old weston-launch facility.