[MPlayer-dev-eng] little patch to libvo/x11_comon.c
Sebastien Renard
Sebastien.Renard at newarch.fr
Mon Oct 21 23:49:10 CEST 2002
Hello there,
Here's a little patch to extend -stop_xscreensaver option for kde screensaver.
I was sick of kde screensaver pop up while playing video, so I took my vi and
try to do someting.
I am not a developper, I just have very basic C knowledge, so please apologize
for my poor coding.
The basics idea of this patch is too make a dcop call to turn on/off the kde
screensaver.
I try to use vo_wm_detect() to ensure kde is used, but i got strange result :
it return NetWM (=1), not KDE (=2), so i just test if dcop kdesktop return 0
(it meens kdesktop is up and attach to dcop).
It should be improve, because if kde screensaver was off, it will be turn on
after mplayer exit.... This state could be fetcjh with
"dcop kdesktop KScreensaverIface isEnabled" (answer is true or false).
Here's below a diff between vanilla x11_comon.c and my modified patch. I use
0.90pre8. I hope this is the right way to submit patch.
Best regards
--
Sébastien Renard -- New'Arch
http://www.newarch.fr
_______________cut here____________________________
761c761
< if (timeout_save)
---
> if (!(system("dcop kdesktop > /dev/null")))
763,766c763,764
< int dummy, interval, prefer_blank, allow_exp;
< XGetScreenSaver(mDisplay, &dummy, &interval, &prefer_blank,
&allow_exp);
< XSetScreenSaver(mDisplay, timeout_save, interval, prefer_blank,
allow_exp);
< XGetScreenSaver(mDisplay, &timeout_save, &interval, &prefer_blank,
&allow_exp);
---
> // use dcop call to turn on kde screensaver
> system("dcop kdesktop KScreensaverIface enable true > /dev/null");
767a766,774
> else
> {
> if (timeout_save)
> {
> int dummy, interval, prefer_blank, allow_exp;
> XGetScreenSaver(mDisplay, &dummy, &interval, &prefer_blank,
&allow_exp);
> XSetScreenSaver(mDisplay, timeout_save, interval, prefer_blank,
allow_exp);
> XGetScreenSaver(mDisplay, &timeout_save, &interval, &prefer_blank,
&allow_exp);
> }
770a778
> }
795,798c803,814
< XGetScreenSaver(mDisplay, &timeout_save, &interval, &prefer_blank,
&allow_exp);
< if (timeout_save)
< XSetScreenSaver(mDisplay, 0, interval, prefer_blank, allow_exp);
< xscreensaver_was_running = stop_xscreensaver && !
system("xscreensaver-command -exit");
---
>
> if (!(system("dcop kdesktop > /dev/null")))
> {
> // use dcop call to turn on kde screensaver
> system("dcop kdesktop KScreensaverIface enable false > /dev/null");
> }
> else
> {
> XGetScreenSaver(mDisplay, &timeout_save, &interval, &prefer_blank,
&allow_exp);
> if (timeout_save)
> XSetScreenSaver(mDisplay, 0, interval, prefer_blank, allow_exp);
> xscreensaver_was_running = stop_xscreensaver && !
system("xscreensaver-command -exit");
799a816
> }
_______________cut here____________________________
More information about the MPlayer-dev-eng
mailing list