Using systemd-logind Session.TakeControl() from Xorg, input needed

Lennart Poettering lennart at poettering.net
Wed Dec 4 10:49:41 PST 2013


On Wed, 04.12.13 17:48, David Herrmann (dh.herrmann at gmail.com) wrote:

> > * Can gdm pass in the session id, or the pid of the session leader
> >   to X when starting X ?
> 
> Just use sd_pid_get_session(). It's in systemd/sd-login.h. It returns
> the session ID of a given process. Don't pass session-ids around.

Actually, with systemd git this is even easier. There's the "virtual"
object path /org/freedesktop/login1/session/self which is an alias for
the session object of the client. Similar there is
/org/freedesktop/login1/user/self and /org/freedesktop/login1/seat/self.

This relieves many clients from every having to look up their own
session/seat/whatever else if they just want to execute an operation on
it.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the xorg-devel mailing list