Mark Shuttleworth wrote:
Right, the XScreenSaver API doesn't provide that level of detail, and doesn't distinguish between mouse or keyboard. Every new input event resets the idle timer, key presses or inadvertent mouse movements.David Barth wrote:However, using the XScreenSaver extension, the X server is maintaining this information for us, so that we can track the idle time, without doing any polling, in particular when no notification is on display.Yes, this gives us a binary "it has moved" or "it has been idle", which is fine for the screensaver because the screensaver only cares if you have been COMPLETELY idle. We might care about a little more detail, like, "is your attention in this part of the screen", which is not the same. For example, if I left the cursor in the top right of the screen after closing a window and my attention is now somewhere else, but I just nudge the touchpad a *little*, the XScreenSaver API will say "not idle", while we probably want to infer that the users attention is not there. Attention is a factor of amount of movement and other activity like clicking. Finally, does the XScreenSaver API separate out mouse movement from keyboard movement? If I leave a mouse pointer in the top right of the screen, but am typing into a window in the bottom left, we want to treat that mouse pointer as idle even though I am busy typing precisely because we are interested in a different region to where the typing is happening. For that precision monitoring we need either to track mouse/keyb every few seconds (but would significantly impact the energy efficiency of the desktop). Or set an eventmask on the root window and see if we can still get the right level of events to infer the user activity. David |