Add SetType method to logind Session interface#14925
Add SetType method to logind Session interface#14925poettering merged 1 commit intosystemd:masterfrom electrickite:set-session-type
Conversation
keszybz
left a comment
There was a problem hiding this comment.
Implementation-wise this looks good. Nevertheless, I'd prefer to wait for @poettering's ack before merging. This PR is assigned to v246, so let's wait for now, it'll not be forgotten.
poettering
left a comment
There was a problem hiding this comment.
sorry for the late review.
looks excellent, some minor comments.
Also, please squash your commits if later commits just fix up earlier commits. i.e. we generally want "perfect" PRs, where each commit is a logical step, but not necessarily a historical one, and everything remains perfectly bisectable. i
|
also needs a rebase |
|
looks great, just two minor nitpicks. |
|
Compositor impl question: should the compositor set |
|
@emersion hmm, you mean the env var? set for what processes precisely? for itself? if the compositor uses SetType to change the type and then goes on and forks off other stuff that is supposed to be part of the same session then yes it probably makes sense to override the env var too, so that things stay in sync. |
Yes, the env var, for other processes.
Ack, thanks. |
|
lgtm |
|
I'm not sure why the bionic-i386 test is failing here, but the errors in the log don't seem related to this PR. |
wlroots/sway now sets it to 'wayland' by itself See: systemd/systemd#14925 swaywm/wlroots#2304
Adds a new method,
SetType, to the logind Session interface.SetTypeallows the session type to be changed, but only by the session's current controller. IfTakeControlhas not been called, the method will fail.In addition, the session type will be reset to its original value once control is released. This should help prevent a session from entering an inconsistent state, for example if the controller crashes.
The sequence to change type is: TakeControl -> SetType. Calling ReleaseControl or otherwise losing session control will reset the Type to its original value.
The method signature is:
SetType(in s arg_0)where arg_0 is the session type name.This should resolve #14489