signalling suspend/resume events (deviceKit-power)

Thiago Macieira thiago at kde.org
Tue Dec 8 15:09:43 GMT 2009


Em Terça-feira 08 Dezembro 2009, às 15:51:02, Richard Hughes escreveu:
> 2009/12/8 Dario Freddi <drf54321 at gmail.com>:
> > But I think a better idea would be having the signal being streamed from
> > upower (since if the aim is providing an unique and future-proof system),
> > triggered from an hook in pm-utils. I think such a solution would be the
> > best of both worlds.
> 
> You have to be careful with signals, as they are not blocking, I mean:
> 
> user clicks suspend
> upower sends Suspending()
> _______________________
> 
> pc is sleeping
> _______________________
> 
> pc awakes
> upower sends Awakening()
> _______________________
> 
> Applications get time to process the Suspending signal call.
> Applications get time to process the Awakening signal call.

There's no guarantee that you'll get a Suspending signal before the machine 
actually suspends. For that reason alone I would recommend against having it.

A signal indicating that we've just returned from some kind of sleep should be 
enough for the app to adjust whatever it needs to adjust.

But please note that the timers may still trigger before the signal is 
processed...

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20091208/58646e26/attachment.sig>


More information about the kde-core-devel mailing list