Index: configure
===================================================================
RCS file: /cvsroot/mplayer/main/configure,v
retrieving revision 1.1159
diff -u -r1.1159 configure
--- configure	4 Apr 2006 05:09:12 -0000	1.1159
+++ configure	11 Apr 2006 20:06:09 -0000
@@ -6802,6 +6802,30 @@
 fi
 echores "$_gethostbyname2"
 
+echocheck "XScreenSaverSuspend"
+cat > $TMPC << EOF
+#include <X11/Xlib.h>
+#include <X11/extensions/scrnsaver.h>
+int main(void) {
+    XScreenSaverSuspend(NULL,True);
+    return 0;
+}
+EOF
+
+_xss_suspend=no
+_ld_xss='-lXss'
+if cc_check $_inc_x11 $_ld_x11 $_ld_xss; then
+ _xss_suspend=yes
+fi
+
+if test "$_xss_suspend" = yes ; then
+  _def_xss_suspend='#define HAVE_XSCREENSAVER_SUSPEND 1'
+else
+  _def_xss_suspend='#undef HAVE_XSCREENSAVER_SUSPEND'
+  _ld_xss=''
+fi
+echores "$_xss_suspend"
+
 # --------------- GUI specific tests begin -------------------
 echocheck "GUI"
 echo "$_gui"
@@ -7260,6 +7284,7 @@
 
 # video output
 X_LIB = $_ld_gl $_ld_dga $_ld_xv $_ld_xvmc $_ld_vm $_ld_xinerama $_ld_x11 $_ld_sock
+XSS_LIB = $_ld_xss
 GGI_LIB = $_ld_ggi
 MLIB_LIB =  $_ld_mlib
 MLIB_INC = $_inc_mlib
@@ -8016,6 +8041,9 @@
 /* do we have gethostbyname2? */
 $_def_gethostbyname2
 
+/* XScreenSaverSuspend support */
+$_def_xss_suspend
+
 /* Extension defines */
 $_def_3dnow	// only define if you have 3DNOW (AMD k6-2, AMD Athlon, iDT WinChip, etc.)
 $_def_3dnowex	// only define if you have 3DNOWEX (AMD Athlon, etc.)
Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/Makefile,v
retrieving revision 1.366
diff -u -r1.366 Makefile
--- Makefile	4 Apr 2006 06:48:14 -0000	1.366
+++ Makefile	11 Apr 2006 20:06:10 -0000
@@ -74,6 +74,7 @@
           $(DIRECTFB_LIB) \
           $(CACA_LIB) \
 	  $(VESA_LIB) \
+          $(XSS_LIB) \
 
 ifeq ($(EXTERNAL_VIDIX),yes)
 VO_LIBS += $(EXTERNAL_VIDIX_LIB)
Index: libvo/x11_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/x11_common.c,v
retrieving revision 1.205
diff -u -r1.205 x11_common.c
--- libvo/x11_common.c	4 Mar 2006 17:33:56 -0000	1.205
+++ libvo/x11_common.c	11 Apr 2006 20:06:22 -0000
@@ -27,6 +27,10 @@
 #include <X11/Xutil.h>
 #include <X11/Xatom.h>
 
+#ifdef HAVE_XSCREENSAVER_SUSPEND
+#include <X11/extensions/scrnsaver.h>
+#endif
+
 #ifdef HAVE_XDPMS
 #include <X11/extensions/dpms.h>
 #endif
@@ -67,6 +71,7 @@
 static int orig_layer = 0;
 static int old_gravity = NorthWestGravity;
 
+int have_xscreensaver_suspend = 0;
 int stop_xscreensaver = 0;
 
 static int dpms_disabled = 0;
@@ -369,6 +374,7 @@
 // int       mScreen;
     int depth, bpp;
     unsigned int mask;
+    int xs_version_major,xs_version_minor;
 
 // char    * DisplayName = ":0.0";
 // Display * mDisplay;
@@ -517,6 +523,12 @@
 
     fstype_dump(vo_fs_type);
 
+#ifdef HAVE_XSCREENSAVER_SUSPEND
+    XScreenSaverQueryVersion(mDisplay, &xs_version_major, &xs_version_minor);
+    if (xs_version_major > 1 || xs_version_minor >= 1)
+        have_xscreensaver_suspend = 1;
+#endif
+
     saver_off(mDisplay);
     return 1;
 }
@@ -1621,10 +1633,17 @@
 
 void saver_on(Display * mDisplay)
 {
-
-#ifdef HAVE_XDPMS
     int nothing;
 
+#ifdef HAVE_XSCREENSAVER_SUSPEND
+    if (have_xscreensaver_suspend)
+    {
+        XScreenSaverSuspend(mDisplay, False);
+        return;
+    }
+#endif
+
+#ifdef HAVE_XDPMS
     if (dpms_disabled)
     {
         if (DPMSQueryExtension(mDisplay, &nothing, &nothing))
@@ -1682,10 +1701,17 @@
 void saver_off(Display * mDisplay)
 {
 
-    int interval, prefer_blank, allow_exp;
+    int interval, prefer_blank, allow_exp, nothing;
+
+#ifdef HAVE_XSCREENSAVER_SUSPEND
+    if (have_xscreensaver_suspend)
+    {
+        XScreenSaverSuspend(mDisplay, True);
+        return;
+    }
+#endif
 
 #ifdef HAVE_XDPMS
-    int nothing;
 
     if (DPMSQueryExtension(mDisplay, &nothing, &nothing))
     {
