[MPlayer-dev-eng] screensaver patch
Adam Tlałka
atlka at pg.gda.pl
Sat Mar 10 11:49:23 CET 2007
A Mennucc napisał(a):
> hi
>
> as you all know, gnome-screensaver is not disabled by
> -stop-xscreensaver ; this problem was reported
> as Debian bug 404975 ; see also
> http://bugzilla.gnome.org/show_bug.cgi?id=335149 ; I also posted
> http://bugzilla.gnome.org/show_bug.cgi?id=416429 asking for Xss support.
>
> I read the whole "kde screensaver" thread , and I tried a few options,
> and I eventually prepared this attached patch (that is for 1.0~rc1 but
> should work for latest SVN as well)
>
> this patch is based on Adam Tlałka idea of moving the mouse
>
> this patch (contrary to the original Adam's patch) does not delete any
> of the other methods for disabling screensavers (let it be X or KDE
> or...) that are in x11_common.c ; it only adds some more code, so that
> the mouse is moved every ~10 sec if the cursor is inside mplayer (or
> gmplayer) window and if it is hidden
From my point of view using XWarpPointer only in mplayer video window
while mouse pointer is hidden is mostly good enough. As I tested it
works with Xserver internal blanking and screensaver, DPMS,
xsreensaver and gnome-screensaver without need to use other hacks.
As I checked XResetScreenSaver call works properly with Xserver methods
so generally beter solution will be to make a patch to xscreensaver and
gnome-screensaver so they notice result of XResetScreenSaver call
and do not activate their actions. So periodically calling
XResetScreenSaver while playing video should be enough in case of
properly working screensaver programs. There is no need for additional
api usage or dirty hacks bound to specific solutions (DBUS,dcop or shell
scripts).
Even if particular screensaver program will not register itself in
Xserver and disable internal saver it could periodically call
XScreenSaverQueryInfo X11 function and check returned idle time.
XResetScreenSaver app call resets idle value to zero so checking
this is a very simple way to make any screensaver program
to work as expected ;). Of course registering it and using event driven
method is more proper then pooling but needs more coding and testing.
It is not a RT situaction here so checking periodically (once a second
for example) is good enough. Adding this code to typical screensaver
program is very easy so better way is to make some patches and send them
to gnome and xorg people (KDE too?) to obtain compatible multiplatform
solution.
Regards
--
Adam Tlałka mailto:atlka at pg.gda.pl ^v^ ^v^ ^v^
System & Network Administration Group - - - ~~~~~~
Computer Center, Gdańsk University of Technology, Poland
PGP public key: finger atlka at sunrise.pg.gda.pl
More information about the MPlayer-dev-eng
mailing list