[AD] Disabeling XScreenSaver

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


I've been digging through mplayer's sources to figure out how they disable 
the XScreenSaver while mplayer is running. This would be a nice thing to 
have in Allegro when running fullscreen, and something which is already in 
the Windows port if I recall correctly.

From what I can tell, it manages this by regularly sending events to the 
xscreensaver window from the main update loop if xscreensaver is running. 
Allegro would have to do this from a background thread, which isn't a very 
nice thing IMO in light of the problems that have popped up with calling X 
functions from the background.
Maybe I'm missing something though - does anyone have experience with this?

What I can do is copy mplayer's code for disabeling the KDE screensaver. I 
have tested this and it works, but it looks rather hacky and ugly to me. 
It consists of calls like system("dcop kdesktop KScreensaverIface 
isEnabled 2>/dev/null | sed 's/1/true/g' | grep true 2>/dev/null >/dev/
null").
If it turns out that I can only get this to work reliably for KDE, then I 
don't think it's worth implementing it into Allegro.

Evert





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/