Closed joakim-tjernlund closed 7 years ago
Tested on 2 different Slackware machines: desktop: hibernate OK laptop: hibernate + suspend not working
Did you also try the same changes for mate-session-manager? I don't know but perhaps mate-pwor-manager and mate-sesion-manager needs to be updated simultaneously.
I think i forgot to patch mate-power-manager and applied the one in mate-session-manager only.
i will try to test again tomorrow
OK, i re-tested in my desktop and it seems i wrote a wrong result in my previous comment desktop: suspend works, but not hibernate (it just went blank, but it restores back to desktop soon)
i will try to test on my laptop tomorrow
Maybe you need upower-0.99 as well?
Slackware 14.2 still uses the old 0.9.23
Suspend is working for me on FreeSlack 14.2. I am not sure what hibernate is supposed to do, but it does make the screen go blank.
@ryanpcmcquen As I recall, hibernate will dump RAM/state to SWAP and if swap is too small you get into trouble. We don't use hibernate though. Did hibernate work before trying this?
Ah, well I have no swap partition, so maybe that's why it doesn't do much here.
Did you also try the same changes for mate-session-manager? I don't know but perhaps mate-pwor-manager and mate-sesion-manager needs to be updated simultaneously.
I will recompile with those.
Any news?
Ha, forgot to retest, I believe everything is working but I will verify that tonight.
very long nights ...
OK, all is working! Sorry that took so long.
Interesting. In src/gpm-control.c
, you've got a mixed logic... You ask consolekit to suspend/hibernate, but checking if it's allowed to do is still done via UpClient
instance. :slightly_smiling_face:
if (!LOGIND_RUNNING()) {
g_object_get (control->priv->client,
"can-suspend", &allowed,
NULL);
if (!allowed) {
egg_debug ("cannot suspend as not allowed from policy");
g_set_error_literal (error, GPM_CONTROL_ERROR, GPM_CONTROL_ERROR_GENERAL, "Cannot suspend");
goto out;
}
}
if (!LOGIND_RUNNING()) {
g_object_get (control->priv->client,
"can-hibernate", &allowed,
NULL);
if (!allowed) {
egg_debug ("cannot hibernate as not allowed from policy");
g_set_error_literal (error, GPM_CONTROL_ERROR, GPM_CONTROL_ERROR_GENERAL, "Cannot hibernate");
goto out;
}
}
So it shouldn't work because properties were removed long ago (in this commit). Please rebase your branch for this PR on git master (https://github.com/mate-desktop/mate-power-manager/commit/a8bd6ca038e373cdb8a9b11409391c0fa85bc319) and test it with upower 0.99 again.
Just in case, a note to people who tested this PR: testing suspend/hibernate buttons in session shutdown dialog is not enough. :slightly_smiling_face:
Let's move to https://github.com/mate-desktop/mate-power-manager/pull/212 for some corrections to this PR.
Forward port of Infrit's CK2 path. This requires ConsoleKit2 0.9.2.