changeset 6303:ad98962908ac

Activating/Deactivating of XScreenSaver patch by Joachim Breitner <mail@joachim-breitner.de>
author arpi
date Tue, 04 Jun 2002 20:12:34 +0000
parents aa9aca7772de
children ee65527096c2
files cfg-mplayer.h libvo/x11_common.c
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/cfg-mplayer.h	Tue Jun 04 20:11:15 2002 +0000
+++ b/cfg-mplayer.h	Tue Jun 04 20:12:34 2002 +0000
@@ -69,6 +69,7 @@
 extern char *mDisplayName;
 extern int WinID;
 extern int ice_layer;
+extern int stop_xscreensaver;
 #endif
 
 #ifdef HAVE_AA
@@ -243,6 +244,8 @@
 	{"wid", &WinID, CONF_TYPE_INT, 0, 0, 0, NULL},
 	{"rootwin", &WinID, CONF_TYPE_FLAG, 0, -1, 0, NULL},
 	{"icelayer", &ice_layer, CONF_TYPE_INT, CONF_RANGE, 0, 15, NULL},
+	{"stop_xscreensaver", &stop_xscreensaver, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+	{"nostop_xscreensaver", &stop_xscreensaver, CONF_TYPE_FLAG, 0, 1, 0, NULL},
 #endif
 
 #ifdef HAVE_XINERAMA
--- a/libvo/x11_common.c	Tue Jun 04 20:11:15 2002 +0000
+++ b/libvo/x11_common.c	Tue Jun 04 20:12:34 2002 +0000
@@ -55,11 +55,13 @@
 #define vo_wm_WMakerStyle 4
 
 int ice_layer=12;
+int stop_xscreensaver=0;
 
 extern int verbose;
 
 static int dpms_disabled=0;
 static int timeout_save=0;
+static int xscreensaver_was_running=0;
 
 char* mDisplayName=NULL;
 Display* mDisplay=NULL;
@@ -798,6 +800,9 @@
 	XGetScreenSaver(mDisplay, &timeout_save, &interval, &prefer_blank, &allow_exp);
     }
 
+    if (xscreensaver_was_running && stop_xscreensaver)
+       system("xscreensaver -no-splash &");
+
 }
 
 void saver_off(Display *mDisplay) {
@@ -824,6 +829,7 @@
     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");
 		    // turning off screensaver
 }