Catching resume from suspend?

Chani chanika at gmail.com
Sat Dec 5 18:46:14 CET 2009


On December 5, 2009 09:21:38 Anders Lund wrote:
> Hi,
> 
> Sorry for crossposting, I hope it is not too bad.
> 
> Now my problem: I have several plasma applets that uses qtimer to schedule
> updates. These updates are then screwed up because of system suspends (I
>  close the lid of my laptop). So I can see two possible solutions:
> 
> 1) a signal that informs about a resume from suspend/standby (I tried to
>  use the powersave plasma dataengine which have state variables, but they
>  are not updated during suspend/resume events)
> 
> 2) using brute force by checking the system time in intervals (such as
>  every minute). In a plasma event this would mean connecting to the time
>  dataengine and compare my scheduled time with the current.
> 
> I ask because I do not have the knowledge to decide what is the best thing
>  to do, or if 1) is possible at all - afaik it is not, since I havent found
>  any working solution for it (I know there is something called KIdleTime in
>  KDE 4.4, but I do not see how that could help in this case).
> 

#2 is Bad and Wrong; imagine every widget doing that, it'd be ridiculous. :)

#1 is the right direction, although the exact implementation may differ... 
ideally dataengines should get kicked when there's a time jump or suspend or 
whatever; all the code to handle this should be in libplasma or higher 
(solid?), and it should Just Work for any dataengine. :) and of course a 
signal should be available for non-plasma stuff.

now, I get the feeling that since it doesn't Just Work yet, Solid doesn't 
provide us with any such signal. this feels like the sort of thing that solid 
*should* provide, but I don't know enough about the low-level details to say 
how it should be implemented.

I imagine that the best case would be hal (or whatever backend solid talks to) 
telling us that we've woken up from suspend; if it doesn't do that, then at 
least when *we* initiate the suspend we could make a note of it and find a way 
to signal when we wake up. but I don't know how that stuff actually works, so 
hopefully someone else can explain how and where you can implement it. :)

the end result should be that developers can either listen for that signal 
from solid, or just use a dataengine. :)

-- 
This message brought to you by eevil bananas and the number 3.
www.chani3.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20091205/d000db3f/attachment.sig 


More information about the Plasma-devel mailing list