KIdleTime library

Tom Albers toma at kde.org
Sun Jul 5 18:05:30 BST 2009


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().
The cpp contains tabs or at least there is a inconsistent indent problem.

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().

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

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.

Toma
-- 
KDE Developer


More information about the kde-core-devel mailing list