[Lazarus] "Defeating" a screen saver

Mark Morgan Lloyd markMLl.lazarus at telemetry.co.uk
Fri Sep 28 13:44:03 CEST 2012


Mark Morgan Lloyd wrote:
> Mark Morgan Lloyd wrote:
>> Graeme Geldenhuys wrote:
>>> On 2012-09-25 17:57, Mark Morgan Lloyd wrote:
>>>> suggestion of looking at the VLC sources I see they use it which has to
>>>> be a recommendation.
>>>
>>> Interesting... I was wondering what they did. :)
>>>
>>>
>>>> I'll see what I can work in, but particularly allowing that
>>>> xdg-screensaver can take several seconds to run it's more suited to
>>>> being run at the start and end of a program session than "on the fly"

> Needs a window ID. I think I can get that from a shell variable if 
> there's a shell, but not if started directly from the desktop: anybody 
> got any thoughts?

Health warning: 
http://lists.lazarus.freepascal.org/pipermail/lazarus/2008-August/037407.html 
suggests following a handle in TForm to arrive at a window ID, but that 
appears to depend on the combination of widget set and window manager: 
as a particular example, it's unreliable with gtk2 on top of KDE.

Without delving into the raw X API, the only reliable way of doing this 
appears to be to run xwininfo and parse the output. The window ID from 
that is compatible with xdg-screensaver.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]




More information about the Lazarus mailing list