Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37884593
en ru br
ALT Linux repos
S:1.0.11-alt2
5.0: 1.0.2-alt6
4.1: 1.0.2-alt6
4.0: 1.0.2-alt3
3.0: 0.9.12-alt2.1

Group :: Video
RPM: tvtime

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: tvtime-1.0.2-alt-xss.patch
Download


--- tvtime-1.0.2/config.h.in.alt	2005-09-15 01:41:48.000000000 +0400
+++ tvtime-1.0.2/config.h.in	2010-04-21 22:24:05.000000000 +0400
@@ -298,6 +298,9 @@
 /* XTest support */
 #undef HAVE_XTESTEXTENSION
 
+/* XScreenSaver support */
+#undef HAVE_XSSEXTENSION
+
 /* Xv support */
 #undef HAVE_XV
 
--- tvtime-1.0.2/configure.ac.alt	2005-09-15 01:40:44.000000000 +0400
+++ tvtime-1.0.2/configure.ac	2010-04-21 22:27:45.000000000 +0400
@@ -124,6 +124,12 @@ if test x"$no_x" != x"yes"; then
             X11_LIBS="$X11_LIBS -lXtst"],,
 	    [$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS -lXext])
 
+	dnl check for XScreenSaver
+        AC_CHECK_LIB([Xss],[XScreenSaverSuspend],
+            [AC_DEFINE([HAVE_XSSEXTENSION],,[XSs support])
+            X11_LIBS="$X11_LIBS -lXss"],,
+	    [$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS -lXext])
+
 	dnl check for Xvidmode
 	AC_CHECK_LIB([Xxf86vm],[XF86VidModeGetModeLine],
 	    [AC_DEFINE([HAVE_XF86VIDMODE],,[XF86VidModeExtension support])
--- tvtime-1.0.2/src/xcommon.c.alt	2005-08-14 21:36:52.000000000 +0400
+++ tvtime-1.0.2/src/xcommon.c	2010-04-21 22:46:43.000000000 +0400
@@ -48,6 +48,9 @@
 #ifdef HAVE_XTESTEXTENSION
 #include <X11/extensions/XTest.h>
 #endif
+#ifdef HAVE_XSSEXTENSION
+#include <X11/extensions/scrnsaver.h>
+#endif
 
 #include "xfullscreen.h"
 #include "speedy.h"
@@ -68,6 +71,7 @@ static Window fs_window;
 static Window output_window;
 static GC gc;
 static int have_xtest;
+static int have_xss;
 static int output_width, output_height;
 static int output_aspect;
 static int output_on_root;
@@ -258,6 +262,16 @@ static int have_xtestextention( void )
     return 0;
 }
 
+static int have_xssextention( void )
+{
+#ifdef HAVE_XSSEXTENSION
+    int dummy1, dummy2;
+
+    return (XScreenSaverQueryExtension( display, &dummy1, &dummy2 ) == True);
+#endif
+    return 0;
+}
+
 static int calculate_gcd( int x, int y )
 {
     if( y > x ) return calculate_gcd( y, x );
@@ -844,6 +858,7 @@ int xcommon_open_display( const char *us
     output_height = 576;
 
     have_xtest = 0;
+    have_xss = 0;
     output_on_root = 0;
     has_ewmh_state_fullscreen = 0;
     has_ewmh_state_above = 0;
@@ -927,12 +942,28 @@ int xcommon_open_display( const char *us
         xfullscreen_print_summary( xf );
     }
 
+    if (getenv("KDE_FULL_SESSION") != NULL)
+    	kde_full_session = 1;
+
+    if (!kde_full_session) {
 #ifdef HAVE_XTESTEXTENSION
-    kc_shift_l = XKeysymToKeycode( display, XK_Shift_L );
+    	kc_shift_l = XKeysymToKeycode( display, XK_Shift_L );
+#endif
+    	have_xtest = have_xtestextention();
+    	if( have_xtest && xcommon_verbose ) {
+        	fprintf( stderr, "xcommon: Have XTest, will use it to ping the screensaver.\n" );
+    	}
+    } else {
+    	have_xss = have_xssextention();
+    	if( have_xss && xcommon_verbose ) {
+        	fprintf( stderr, "xcommon: Have XSS, will use it to disable the screensaver.\n" );
+    	}
+
+#ifdef HAVE_XSSEXTENSION
+    	if ( have_xss ) {
+        	XScreenSaverSuspend( display, True );
+     	}
 #endif
-    have_xtest = have_xtestextention();
-    if( have_xtest && xcommon_verbose ) {
-        fprintf( stderr, "xcommon: Have XTest, will use it to ping the screensaver.\n" );
     }
 
     /* Initially, get the best width for our height. */
@@ -1715,6 +1746,11 @@ void xcommon_poll_events( input_t *in )
 
 void xcommon_close_display( void )
 {
+#ifdef HAVE_XSSEXTENSION
+    if ( have_xss && kde_full_session ) {
+        XScreenSaverSuspend( display, False );
+    }
+#endif
     XDestroyWindow( display, output_window );
     XDestroyWindow( display, wm_window );
     XDestroyWindow( display, fs_window );
--- tvtime-1.0.2/src/xcommon.h.alt	2005-08-14 21:23:05.000000000 +0400
+++ tvtime-1.0.2/src/xcommon.h	2010-04-21 22:35:48.000000000 +0400
@@ -26,6 +26,8 @@
 extern "C" {
 #endif
 
+static int kde_full_session = 0;
+
 typedef struct {
     int x;
     int y;
--- tvtime-1.0.2/src/xvoutput.c.alt	2005-08-14 21:35:50.000000000 +0400
+++ tvtime-1.0.2/src/xvoutput.c	2010-04-21 22:45:20.000000000 +0400
@@ -326,7 +326,9 @@ static int xv_show_frame( int x, int y,
 
     xcommon_set_video_scale( scale_area );
 
-    xcommon_ping_screensaver();
+    if (!kde_full_session)
+    	xcommon_ping_screensaver();
+
     if( use_shm ) {
         XvShmPutImage( display, xv_port, output_window, xcommon_get_gc(),
                        image, x, y, width, height, video_area.x, video_area.y,
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin