Add ability to suspend/hibernate via logind #55

Merged
merged 2 commits into from May 2, 2013

Conversation

Projects
None yet
4 participants
Contributor

boyarsh commented Apr 8, 2013

With upower 0.9.20, sleep and hybernate functions of upower
declared deprecated. All applications should use logind for
sleep/hybernate. So, there is an implementation of
logind-powered sleep for mpm.

boyarsh added some commits Apr 8, 2013

add logind sleep ability
With upower 0.9.20, sleep and hybernate functions of upower
declared deprecated. All applications should use logind for
sleep/hybernate. So, there is an implementation of
logind-powered sleep for mpm.
crash when suspending via logind fixed
On some machins it seems to be a race condition in dbus
when suspend via systemd. Here is a workaround.
Contributor

dmashal commented Apr 21, 2013

Confirmed the fix. Please merge this. Thank you for fixing this @boyarsh

Contributor

bhull2010 commented Apr 21, 2013

up_client_get_lid_is_closed()
and
up_client_get_lid_is_present()
are not listed as deprecated here:
http://cgit.freedesktop.org/upower/tree/libupower-glib/up-client.h#n110

Why is this patch adding these as separate implementations (gpm_button_get_lid_is_closed, ...)?

Contributor

dmashal commented Apr 21, 2013

@bhull2010 I think the point of this fix is to completely bypass upower and use systemdinhibit.. correct me if I'm wrong but there is a bug in upower that is causing the original issue.

Contributor

bhull2010 commented Apr 22, 2013

@dmashal
https://github.com/mate-desktop/mate-power-manager/pull/55/files#L1R263
is using upower for the detection of the lid being closed (I don't think systemd/logind has this function since it only does suspend/hibernate, not battery level monitoring, etc.). Since it calls upower, this is basically the same thing that libupower-glib is already doing:
http://cgit.freedesktop.org/upower/tree/libupower-glib/up-client.c#n314

Contributor

boyarsh commented Apr 22, 2013

@bhull2010 But i unfortunatly found that it always report lid open in upower 0.9.20. May be it is a bug somwere.

Contributor

dmashal commented May 1, 2013

This has been confirmed fixed on Fedora when using lightdm.

https://bugzilla.redhat.com/show_bug.cgi?id=949070

@dmashal dmashal referenced this pull request May 1, 2013

Closed

Systemd-login support #29

stefano-k added a commit that referenced this pull request May 2, 2013

Merge pull request #55 from boyarsh/master
Add ability to suspend/hibernate via logind

@stefano-k stefano-k merged commit acbec2f into mate-desktop:master May 2, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment