The issue is apparently in mate-session-manager (1.8.1).
Since I can see the following when running "upower -d" and suspend/hibernate using d-bus as an ordinary user works (!) then there is another issue at work.
Code:
can-suspend: yes
can-hibernate yes
on-battery: no
on-low-battery: no
lid-is-closed: no
lid-is-present: yes
is-docked: no
According to
this thread people were having similar issues when using new versions of upower with (and without) systemd. If we look at ./mate-session/gsm-logout.c there is a function that looks like this (and a similar one for suspend as well):
Code:
static gboolean
gsm_logout_supports_system_hibernate (GsmLogoutDialog *logout_dialog)
{
gboolean ret;
ret = FALSE;
#ifdef HAVE_SYSTEMD
if (LOGIND_RUNNING())
ret = gsm_systemd_can_hibernate (logout_dialog->priv->systemd);
#endif
#if defined(HAVE_SYSTEMD) && defined(HAVE_UPOWER)
else
#endif
#ifdef HAVE_UPOWER
ret = up_client_get_can_hibernate (logout_dialog->priv->up_client);
#endif
return ret;
}
Ideally having upower would be enough to get ret set to the appropriate value but it just never happens. There was no such sanity check in version 1.4 so I just deleted everything inside the function and replaced it with
Code:
return up_client_get_can_hibernate (logout_dialog->priv->up_client);
That forcibly brings back the buttons. Remember, this is only safe or relevant when you know that suspend/hibernate as ordinary user works...