[MPlayer-dev-eng] [RFC] kde screensaver stuff using system()
Adam Tlałka
atlka at pg.gda.pl
Wed Feb 7 13:35:22 CET 2007
Dnia Wed, 7 Feb 2007 07:01:15 +0100
Attila Kinali <attila at kinali.ch> napisał(a):
> Moin,
>
> Please, do NOT cc people on MPlayer mailinglists.
> We are subscribed and don't need the mail twice.
>
> On Tue, 6 Feb 2007 22:45:23 +0100
> Adam Tlałka <atlka at pg.gda.pl> wrote:
>
> > The problem is we want to see the video and unexpected screensaver
> > activation could be treated like a bad video driver.
>
> We never provided workarounds against bad video drivers
> either.
>
> > Of course assuming some particular type of screensaver and protocol
> > of communication is just wrong. If we can do something it should be
> > as simple as possible.
>
> Then have a look at the screensaver disabling code
> and how it evolved. It was once simple, but it never
> worked for more than one or two screensaver implementations.
>
> > Generation of key events is not good but maybe we
> > could just generate mouse movements instead. While mouse pointer is
> > set to invisible we can just move it a bit left and then right from
> > time to time while playing video. Because we know the pointer
> > destination we will filter these events and any real mouse movement
> > will restore normal behaviour until next pointer hidding.
> > What about this ?
>
> As bad as generating key events.
Not quite as bad as you think.
Using XWarpPointer(3X11) function you do not need to use any special
Xserver extension and it should work with any screensaver and raw
Xserver DPMS settings too.
I've just wrote a small program which opens X11 window and then
periodically moves the mouse pointer 16 pixels right then left.
Test shows that X11 DPMS, xscreensaver and gnome screensaver works
properly with this approach (no screensaver activation).
I do not have KDE so it should be tested too.
So for example XwarpPointer(display, window, None, 0, 0, window_width,
window_height, distx, 0); moves the mouse pointer relatively to
its current position only if it is inside my window. We can set
pointer shape so it is invisible in our window and then activate this
pointer movements for example one movement for a minute if there is no
other user supplied mouse or keyboard events.
This solution doesn't need any new protocol or properties setting.
Maybe this is a hack but not too complicated and it works.
Regards
--
Adam Tlałka mailto:atlka at pg.gda.pl ^v^ ^v^ ^v^
More information about the MPlayer-dev-eng
mailing list