[Kde-hardware-devel] PowerManager idleTime

Sebastian Kuegler sebas at kde.org
Tue May 13 22:25:03 CEST 2008


On Tuesday 13 May 2008 22:04:37 Thomas Gillespie wrote:
> 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.

X people had added a function some time ago that you feed a time and it 
notifies you when this time has passed idle. I don't know the names, 
though. :/
-- 
sebas

 http://www.kde.org | http://vizZzion.org |  GPG Key ID: 9119 0EF9 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 481 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kde-hardware-devel/attachments/20080513/51ac894f/attachment.pgp 


More information about the Kde-hardware-devel mailing list