Skip to content

Separate out the logout and suspend inhibits

Michael Terry requested to merge mterry/gnome-session:separate-inhibits into master

Previously, SUSPEND would result in "sleep:shutdown" being sent to systemd/ck. With this PR, SUSPEND adds "sleep" and LOGOUT adds "shutdown" to the request we send. See the issue below for full reasoning, but I believe this tracks closer to the documentation for those flags than the previous behavior.

This PR also updates the GsmSystem interface to not track inhibitors individually by id, but just be given the unified flags. I did this because both systemd and ck really only care about the unified result (easier to have just one inhibit going and CK says it requires it). And to achieve what this MR wants, we'd need to have the GsmSystem implementations track the unified flags themselves anyway, which seemed like pointless redundancy.

I say that CK says it requires it. I base that off this comment in its code: https://github.com/ConsoleKit2/ConsoleKit2/blob/48670b3861e56836ac7c344412f9578f0716bc61/src/ck-inhibit-manager.c#L179-L180

But I can't find any evidence in their code of that actually being true? If it is true, I should have my consolekit changes actually drop our inhibit before requesting a new one, which introduces a race. But I can't find evidence in the consolekit code that it actually does require that. So I didn't drop the inhibit first. (This wasn't a problem with this code before, since we only ever asked for one kind of inhibit anyway.)

I would test with CK, but I don't have a machine lying around that is old enough to support it. I can install an old distro and confirm if you like? I'm not sure how "supported" the consolekit backend really is.

#69 (closed)

Edited by Michael Terry

Merge request reports