changeset 8097:440dd85936d1

yet another screensaver fix
author henry
date Mon, 04 Nov 2002 08:21:46 +0000
parents f6ffe802f526
children 2fa1e3aa518a
files libvo/x11_common.c
diffstat 1 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/x11_common.c	Mon Nov 04 02:16:00 2002 +0000
+++ b/libvo/x11_common.c	Mon Nov 04 08:21:46 2002 +0000
@@ -755,6 +755,7 @@
                 // DPMS does not seem to be enabled unless we call DPMSInfo
 	        BOOL onoff;
         	CARD16 state;
+		DPMSForceLevel(mDisplay, DPMSModeOn);
         	DPMSInfo(mDisplay, &state, &onoff);
                 if (onoff) {
 	            mp_msg(MSGT_VO,MSGL_INFO,"Successfully enabled DPMS\n");
@@ -776,8 +777,10 @@
 	timeout_save=0;
     }
 
-    if (xscreensaver_was_running && stop_xscreensaver)
-       system("xscreensaver -no-splash &");
+    if (xscreensaver_was_running && stop_xscreensaver) {
+	system("cd /; xscreensaver -no-splash &");
+	xscreensaver_was_running = 0;
+    }
 
 }
 
@@ -802,9 +805,11 @@
 	}
     }
 #endif
-    XGetScreenSaver(mDisplay, &timeout_save, &interval, &prefer_blank, &allow_exp);
-    if (timeout_save)
-	XSetScreenSaver(mDisplay, 0, interval, prefer_blank, allow_exp);
+    if (!timeout_save) {
+	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
 }