KIdleTime library

Dario Freddi drf54321 at gmail.com
Sun Jul 5 18:33:43 BST 2009


On Sunday 05 July 2009 19:05:30 Tom Albers wrote:
> Op Sunday 05 July 2009 18:23 schreef u:
> > Uhm, I'm not sure if I got you here. Basically, you could start a QTimer
> > every second, that polls KIdleTime::instance()->idleTime(). If the return
> > value of idleTime() is inferior to 1000 (1 second), then the user has
> > been active in that second. Otherwise, the user has been inactive. Is
> > that what you were looking for?
>
> Yep, perfect.
> The API is getIdleTime(), that should be idleTime().

Nice catch

> The cpp contains tabs or at least there is a inconsistent indent problem.

astyle, come to me :D

>
> Not sure if you are using XScreenSaverQueryInfo( QX11Info::display(),
> QX11Info::appRootWindow(), _mit_info ); calls. But if you do, please note
> that there is a bug in X that sets the idle time to 0 when the dpms kicks
> in. The library should work around that bug to give a proper idleTime().

No problem: I'm using the way more efficient XSync for linux. No polling and 
no bugs :)

>
> Also there is the question what you do when the system has hibernated and
> wakes up, how is that handled?

Theorically that should count as an user action. I'll add some special cases 
if testing creates some problems, though

>
> If you set two catchIdleTimeout() (maybe call them idleTrigger() or
> setIdleTimeout()?), will the signal timeoutReached() (maybe call it
> timeout(), like QTimer) respond with the exact same msec? not 1 msec more
> or less, right? else it is important to see which of the triggers is
> responding.

At the moment the library supports just one timeout at a time, but it will 
support more than one. Obviously msec corresponds to the timeout value. The 
final API would be something like

addIdleTimeout(int)
removeIdleTimeout()
removeAllIdleTimeouts()

ditching away the 2 current functions. Sounds cool?

>
> Toma

-- 
-------------------

Dario Freddi
KDE Developer
GPG Key Signature: 511A9A3B
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20090705/e259e91d/attachment.sig>


More information about the kde-core-devel mailing list