Sleeping signal is only emitted if AboutToSleep is called
Tobias Arrskog
topfs2 at xboxmediacenter.com
Fri May 7 12:30:14 PDT 2010
Hi!
I'm one of the developer over at team-xbmc and I recently noticed that
UPower have added the Sleeping and Resuming signals, awesome!
I noticed a problem with them when implementing them into xbmc however. The
resuming signal works fine but the sleeping signal is only emitted if I call
AboutToSleep.
According to docs its supposed to be emitted on calls to hibernate and
suspend aswell, which its not. In XBMC we could easily call AboutToSleep
first but gnome doesn't seem to do this and
then the event won't get emitted to us and we are kept in the dark about the
sleep.
Also as an application all what I want is signals that happen when 1) a
sleep will occur unless something goes terribly wrong (but note here it
should be beyond the point of no return regarding cancelation of sleep). 2)
on resume (this one works perfectly) and optionally 3) when the system might
sleep but I have the power to cancel it.
In 1 I must assume that the system will sleep and I can do stuff like stop
playback etc. and 1 second is enough to handle anything to prepare for that.
3 would be nice since then I can do certain stuff that won't interfere with
the usage of the application, like auto-saving something in case the sleep
would fail. This one could easily be optional for the application thats
about to call since the actual suspend will still signal sleeping.
I consider the current sleep signal being 1, thus it might be abit weird to
have AboutToSleep signal Sleeping since there is no obligation for another
application to call suspend / hibernate. Perhaps I assume wrong here?
Thanks for an awesome job, the new UPower is otherwise extremely good!
(UDisk and those are aswell very nice).
Cheers,
Tobias.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/devkit-devel/attachments/20100507/39df2979/attachment.htm>
More information about the devkit-devel
mailing list