KIdleTime : provide a settable resolution for the polling backends?

René J.V. Bertin rjvbertin at gmail.com
Mon Nov 16 21:31:02 UTC 2015


Hi,

Working on modernising the OS X plugin for KIdleTime, I realised that there is no mechanism foreseen to set the frequency at which the current system idle time should be sampled on those platforms that need to use a polling approach (OS X, MS Windows and apparently also XScreenSaver).

The frequency with which idle time is polled (sampled) determines the delay with which the resumingFromIdle signal can be sent, but also the precision of the timeoutReached signals.

At the moment I'm using a QTimer interval of 0 to poll idle time, meaning the timer fires and idletime is fired about as fast as possible when there are no events to process. That is fine for a system that wants to react as fast as possible to the end of an idle period, but probably overkill in many other situations. It strikes me that the required resolution is something that only the calling code can know, though there are probably several values that are reasonable defaults (10x per second seems a bit much, 4x maybe just too low).

Thoughts?

R.


More information about the Kde-frameworks-devel mailing list