changeset 12787:7aa852ffba45

fix for xscreensaver disabling
author reimar
date Fri, 09 Jul 2004 18:59:55 +0000
parents b0060a6c4768
children a6ff4398e4e6
files libvo/vo_sdl.c
diffstat 1 files changed, 6 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_sdl.c	Fri Jul 09 17:32:17 2004 +0000
+++ b/libvo/vo_sdl.c	Fri Jul 09 18:59:55 2004 +0000
@@ -1575,13 +1575,10 @@
 uninit(void)
 {
 #ifdef HAVE_X11
-	static Display *XDisplay;
-    XDisplay = XOpenDisplay(NULL);
-    if(XDisplay) {
+    struct sdl_priv_s *priv = &sdl_priv;
+    if(priv->X) {
 		if(verbose) printf("SDL: activating XScreensaver/DPMS\n");
-
-		saver_on(XDisplay);
-		XCloseDisplay(XDisplay);
+		vo_x11_uninit();
 	}
 #endif
 	sdl_close();
@@ -1597,10 +1594,6 @@
 static uint32_t preinit(const char *arg)
 {
     struct sdl_priv_s *priv = &sdl_priv;
-#ifdef HAVE_X11	
-    static Display *XDisplay;
-    static int XScreen;
-#endif
 
     priv->rgbsurface = NULL;
     priv->overlay = NULL;
@@ -1635,16 +1628,12 @@
 
     priv->X = 0;
 #ifdef HAVE_X11
-    XDisplay = XOpenDisplay(NULL);
-    if(XDisplay) {
+    if(vo_init()) {
 		if(verbose) printf("SDL: deactivating XScreensaver/DPMS\n");
-		XScreen = DefaultScreen(XDisplay);
-		priv->XWidth = DisplayWidth(XDisplay, XScreen);
-		priv->XHeight = DisplayHeight(XDisplay, XScreen);
+		priv->XWidth = vo_screenwidth;
+		priv->XHeight = vo_screenheight;
 		priv->X = 1;
 		if(verbose) printf("SDL: X11 Resolution %ix%i\n", priv->XWidth, priv->XHeight);
-		saver_off(XDisplay);
-		XCloseDisplay(XDisplay);
 	}
 #endif