# HG changeset patch # User arpi # Date 1039044706 0 # Node ID 8a0b6e0832800951274016b40aef972e7b9bedb1 # Parent 6dd42a044681ea6f03133f59af76d62d7d0943c4 This patch fixes the screensaver issues in mplayer. It will correctly read and store the state of XScreensaver and KDE-Screensaver, will stop them and restart them later, when the movie has finished ... It works and was tested with KDE2/3 and XScreensaver 4.05. patch by Fabian Franz diff -r 6dd42a044681 -r 8a0b6e083280 libvo/x11_common.c --- a/libvo/x11_common.c Wed Dec 04 23:29:41 2002 +0000 +++ b/libvo/x11_common.c Wed Dec 04 23:31:46 2002 +0000 @@ -53,6 +53,7 @@ static int dpms_disabled=0; static int timeout_save=0; static int xscreensaver_was_running=0; +static int kdescreensaver_was_running=0; char* mDisplayName=NULL; Display* mDisplay=NULL; @@ -787,6 +788,11 @@ system("cd /; xscreensaver -no-splash &"); xscreensaver_was_running = 0; } + if (kdescreensaver_was_running && stop_xscreensaver) { + system("dcop kdesktop KScreensaverIface enable true 2>/dev/null >/dev/null"); + kdescreensaver_was_running = 0; + } + } @@ -816,8 +822,19 @@ if (timeout_save) XSetScreenSaver(mDisplay, 0, interval, prefer_blank, allow_exp); } - xscreensaver_was_running = stop_xscreensaver && ! system("xscreensaver-command -exit"); // turning off screensaver + if (stop_xscreensaver && !xscreensaver_was_running) + { + xscreensaver_was_running = (system("xscreensaver-command -version 2>/dev/null >/dev/null")==0); + if (xscreensaver_was_running) + system("xscreensaver-command -exit 2>/dev/null >/dev/null"); + } + if (stop_xscreensaver && !kdescreensaver_was_running) + { + kdescreensaver_was_running=(system("dcop kdesktop KScreensaverIface isEnabled 2>/dev/null | sed 's/1/true/g' | grep true 2>/dev/null >/dev/null")==0); + if (kdescreensaver_was_running) + system("dcop kdesktop KScreensaverIface enable false 2>/dev/null >/dev/null"); + } } static XErrorHandler old_handler = NULL;