Comment 3 for bug 1631707

Revision history for this message
In , fitzcarraldo1 (fitzcarraldo1-gentoo-bugs) wrote :

Created attachment 459582
Patch to liblightdm-gobject/power.c to use ConsoleKit for Suspend/Hibernate

When using =>x11-misc/lightdm-1.18.3 it is not possible to select Suspend or Hibernate on the LightDM login screen of a Gentoo installation that does not use systemd. This is because x11-misc/lightdm uses systemd-logind for Suspend/Hibernate, with upower as the fallback. I am assuming that sys-power/upower, sys-power/pm-utils and sys-auth/consolekit are installed.

In an installation that does not use systemd the Suspend and Hibernate entries in the Power pull-down menu on the LightDM GTK Greeter (x11-misc/lightdm-gtk-greeter-2.0.1-r1) are greyed-out and unusable.

In an installation that does not use systemd, the Suspend button on the LightDM KDE Greeter (lightdm-kde-0.3.2.1-r1) is greyed-out and unusable. (The Hibernate button is configured by default to be hidden, but would also be greyed-out were it configured to be visible.)

I have not tried the other LightDM greeters, but, due to the current coding in liblightdm-gobject/power.c, I cannot conceive that Suspend/Hibernate could be selectable from any of the greeters in an installation that does not use systemd.

The current code of liblightdm-gobject/power.c uses org.freedesktop.login1 for each of Suspend, Hibernate, Restart and Shutdown. The code falls back to org.freedesktop.UPower for Suspend/Hibernate, and falls back to org.freedesktop.ConsoleKit for Restart/Shutdown.

The attached patch to power.c replaces the use of UPower with ConsoleKit.

If I apply the attached patch, Suspend and Hibernate buttons on the GTK Greeter are no longer greyed-out and they can be used to Suspend/Hibernate the machine. (Unfortunately, the code of lightdm-kde-0.3.2.1-r1 is several years old and only appears to cater for org.freedesktop.UPower, therefore, even with the attached patch applied to x11-misc/lightdm-1.18.3, Suspend/Hibernate are still inactive on the KDE Greeter.)