Get the logind session to take over through env variable instead of own PID
ClosedPublic

Authored by graesslin on Apr 19 2016, 8:36 AM.

Details

Summary

So far KWin resolved the logind session to take over by using its own
PID with the method GetSessionByPID. This doesn't work if KWin itself
is not part of the session or if KWin is supposed to take over a
different session.

The session to take over can now be provided by the env variable:
KWIN_LOGIN_SESSION

This allows to e.g. run kwin on vt1, but have the graphical output
on vt2. Thus it's possible to see the debug output. Also it should allow
to run kwin_wayland through an ssh session, so that gdb can be used.

If we take over another session on a different vt, we need to make sure
that it's the current virtual terminal. Otherwise assumptions in the
startup code would break. So let's ensure the session we integrate with
is active.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin updated this revision to Diff 3407.Apr 19 2016, 8:36 AM
graesslin retitled this revision from to Get the logind session to take over through env variable instead of own PID.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added a reviewer: Plasma.
Restricted Application added a project: Plasma. · View Herald TranscriptApr 19 2016, 8:36 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
graesslin updated this revision to Diff 3408.Apr 19 2016, 9:14 AM

Use the standardized XDG_SESSION_ID instead of a custom env variable

bshah accepted this revision.Apr 20 2016, 2:17 PM
bshah added a reviewer: bshah.
bshah added a subscriber: bshah.

Please adjust commit message to remove reference of KWIN_LOGIN_SESSION before landing this.

This revision is now accepted and ready to land.Apr 20 2016, 2:17 PM
This revision was automatically updated to reflect the committed changes.