signalling suspend/resume events (deviceKit-power)
anders at alweb.dk
Tue Dec 8 15:07:41 GMT 2009
Richard Hughes skrev:
> 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.
> So you get a nice race.
When looking at pm-utils docs and some of the scripts, I thought that the
easiest thing would be using a signal, because it would be available to
anyone. But it seems that blocking call is nessecary for applications wanting
to act prior to a suspend then.
Maybe a signal for resume events would be a good idea in any case, since it
would cover most (desktop application) usecases (at least cases I see)?
Or would a method call to a desktop specific daemon (powerdevil or solid)
allow calls in other apps to be executed?
More information about the kde-core-devel