launcher-logind: Try the user's primary session if not in a session
If we're not in a session we can fall back to sd_uid_get_display() to find the user's primary session.
This allows launching weston from an ssh session or as a systemd user service if a viable session is available.
It also more closely follows how libseat finds the session. The libseat launcher can already do these things, so this change makes these features common to both launchers.
Based on a patch by Sjoerd Simons sjoerd.simons@collabora.com
Signed-off-by: Derek Foreman derek.foreman@collabora.com
Fixes: #401 (closed) Fixes: #132 (closed)
Edited by Daniel Stone