[MPlayer-dev-eng] [RFC] kde screensaver stuff using system()

Ivan Kalvachev ikalvachev at gmail.com
Wed Feb 7 17:34:17 CET 2007


2007/2/7, Rich Felker <dalias at aerifal.cx>:
> On Wed, Feb 07, 2007 at 10:24:46AM +0100, Adam Tlałka wrote:
> > Dnia Wed, 7 Feb 2007 14:16:36 +0800
> > "Zuxy Meng" <zuxy.meng at gmail.com> napisał(a):
> >
> > > Hi,
> > >
> > > 2007/2/7, Diego Biurrun <diego at biurrun.de>:
> > > > On Mon, Feb 05, 2007 at 03:53:10PM +0100, Reimar Döffinger wrote:
> > > > > I do feel a bit uncomfortable about this, it seems extremely like
> > > > > a hack to me.
> > > > > Is there no better way?
> > > > > Do we really have to handle this screensaver mess?
> > > > > Any other comments?
> > > >
> > > > We were talking about this on IRC the other day.  A problem that we
> > > > currently have is that gnome screensaver is not stopped, which is an
> > > > annoyance for users.  An annoyance that distros have started working
> > > > around in multiple different and mostly hackish ways.
> > > >
> > > > A way out of this dilemma might be generating keypress events at
> > > > regular intervals.  It promises to work across all platforms and
> > > > not need to be extended for the screensaver du jour ..
> > >
> > > Ever since Win98 Windows provides an API called
> > > SetThreadExecutionState() that can be used as a heartbeat function to
> > > prohibit screensavers. Anything similar in X Windows?
> >
> > Why in X Windows? It should be more generic app state.
>
> No, this is the mistake the GNOME folks are making. There is no such
> thing as a generic app because the app could be anywhere on the planet
> or beyond, not just on the same host!! Any local method is
> fundamentally flawed because it cannot account for this. We're talking
> about an _X_ _screensaver_ here, so the method of disabling it must go
> through the X protocol, not out-of-band local channels.

I did a little investigation. It looks like XFree86 people have solved
KDE and Gnome screensaver problems about 4 years ago, but have failed
to notify them.

Really.

There is extensions since XFree 4.3.0.1 that allows every X program to
register as screensaver and get Notified insted of the "system" X
screensaver.
( http://webcvs.freedesktop.org/xorg/xserver/xorg/Xext/saver.c?view=log )

The extension is included by "include/X11/extensions/scrnsaver.h".
There is sample screensaver program called "beforelight" that is
compiled as part of Xorg that uses this extension.
http://webcvs.freedesktop.org/xorg/app/beforelight/

It's strange but when googling about the extension the first hit was
in http://www.hmug.org/man/3/XScreenSaverGetRegistered.php and I think
this description is pretty complete. However I couldn't find anything
about it in the Xorg documentation. Maybe we should commission Diego
to xorg for a while ;)

I really like Reimar idea about sending ScreenSaverEvent to the
focused program so it can suppress the activation of screensaver, but
I think this would be better done through the existing X extension
than using window managers.


More information about the MPlayer-dev-eng mailing list