gnome-control-center: hibernation vs suspend when energy is low

Gautier Pelloux-Prayer <[email protected]> Sat, 16 May 2015 15:33:30 +0200
Newsgroups gmane.comp.gnome.devel
Message-ID <[email protected]>
--===============3164726094823982527==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline



--===============3164726094823982527==
Content-Type: multipart/alternative; boundary="=-iVltJt8z1kwcyC160UgL"

--=-iVltJt8z1kwcyC160UgL
Content-Type: text/plain; charset=utf-8; format=flowed

Hi,

In gnome-control-center application, one can configure its laptop to go 
in suspend mode when Energy goes very low. However this is only 
possible when laptop supports Hibernation, as cc-power-panel.c:1945 
queries DBus:

  result = g_dbus_connection_call_sync (connection,
                                        "org.freedesktop.login1",
                                        "/org/freedesktop/login1",
                                        
"org.freedesktop.login1.Manager",
                                        "CanHibernate",
                                        NULL,
                                        NULL,
                                        G_DBUS_CALL_FLAGS_NONE,
                                        -1,
                                        NULL,
                                        NULL);


Instead of asking for "CanHibernate", should not it be asking for 
"CanSuspend" feature (or both?). In my personal case, I do not have any 
SWAP so hibernation is not available, but suspend is:

$ qdbus --system --literal org.freedesktop.login1 
/org/freedesktop/login1 org.freedesktop.login1.Manager.CanHibernate
"na"
$ qdbus --system --literal org.freedesktop.login1 
/org/freedesktop/login1 org.freedesktop.login1.Manager.CanSuspend
"yes"

I would like to suspend computer instead of shutting it down when 
Energy is critical. Is it the right place to discuss about it, or 
should I ask somewhere else?

Thanks!

--=-iVltJt8z1kwcyC160UgL
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi,<div><br></div><div>In gnome-control-center application, one can configu=
re its laptop to go in suspend mode when Energy goes very low. However this=
 is only possible when laptop supports Hibernation, as cc-power-panel.c:194=
5 queries DBus:</div><div><br></div><div><div>&nbsp; result =3D g_dbus_conn=
ection_call_sync (connection,</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; "org.freedesktop.login1",</div><div>&nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "/org/freedesktop/l=
ogin1",</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; "org.freedesktop.login1.Manager",</div><div>&nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "CanHibernate",</div><div>&nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NULL,</div><div>&=
nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NULL,</div>=
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; G_DBU=
S_CALL_FLAGS_NONE,</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; -1,</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; NULL,</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; NULL);</div></div><div><br></div><div><br></di=
v><div>Instead of asking for "CanHibernate", should not it be asking for "C=
anSuspend" feature (or both?). In my personal case, I do not have any SWAP =
so hibernation is not available, but suspend is:</div><div><br></div><div><=
div>$ qdbus --system --literal org.freedesktop.login1 /org/freedesktop/logi=
n1 org.freedesktop.login1.Manager.CanHibernate</div><div>"na"</div></div><d=
iv><div>$ qdbus --system --literal org.freedesktop.login1 /org/freedesktop/=
login1 org.freedesktop.login1.Manager.CanSuspend</div><div>"yes"</div></div=
><div><br></div><div>I would like to suspend computer instead of shutting i=
t down when Energy is critical. Is it the right place to discuss about it, =
or should I ask somewhere else?</div><div><br></div><div>Thanks!</div>=

--=-iVltJt8z1kwcyC160UgL--


--===============3164726094823982527==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
gnome-devel-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/gnome-devel-list

--===============3164726094823982527==--