[Kde-hardware-devel] PowerManager idleTime

Thomas Gillespie tomjamesgillespie at googlemail.com
Tue May 13 22:04:37 CEST 2008


Hi again,

I'm developing a power manager, and have the following code to get the idle 
time:

-------------------------------------------------------------------------------------------------
#include <QX11Info>
#include <X11/extensions/scrnsaver.h>

///Return the Xserver idle time in msecs
int idleTime()
{
    XScreenSaverInfo* mitInfo = 0;
    mitInfo = XScreenSaverAllocInfo ();
    XScreenSaverQueryInfo (QX11Info::display(), DefaultRootWindow 
(QX11Info::display()), mitInfo);
    return mitInfo->idle;
}
-------------------------------------------------------------------------------------------------

I think this would be better pushed into solid powermanager, or something 
similar to this? Any opinions? I could knock up a patch if this sounds ok.

Thanks

Tom

P.s. are the notifiers broken again? I am using notifier() this time :) but 
again no output from my test app
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kde-hardware-devel/attachments/20080513/11f7281b/attachment.pgp 


More information about the Kde-hardware-devel mailing list