]> git.sesse.net Git - vlc/commitdiff
Default to disabling screensaver under X (Closes:#253)
authorClément Stenac <zorglub@videolan.org>
Sat, 17 Sep 2005 12:12:54 +0000 (12:12 +0000)
committerClément Stenac <zorglub@videolan.org>
Sat, 17 Sep 2005 12:12:54 +0000 (12:12 +0000)
Hide screensaver interface from the prefs

modules/misc/screensaver.c
src/libvlc.c
src/libvlc.h

index 2995fdcb45d2e3a72ac71367f0aa4e17b2b22f3e..2ceffbf0bb7322a758f9fbaba13b8c49d7dbe93f 100644 (file)
@@ -41,8 +41,6 @@ static void Run          ( intf_thread_t *p_intf );
  * Module descriptor
  *****************************************************************************/
 vlc_module_begin();
-    set_category( CAT_INTERFACE );
-    set_subcategory( SUBCAT_INTERFACE_CONTROL );
     set_description( _("X Screensaver disabler") );
     set_capability( "interface", 0 );
     set_callbacks( Activate, NULL );
index 333726aed77431aac7e92722b7cfb16016b193b7..1b88fbe8855d57871329ac1f7ded9a4985c095cc 100644 (file)
@@ -748,10 +748,21 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
     }
 
     /*
-     * Allways load the hotkeys interface if it exists
+     * Always load the hotkeys interface if it exists
      */
     VLC_AddIntf( 0, "hotkeys,none", VLC_FALSE, VLC_FALSE );
 
+    /*
+     * If needed, load the Xscreensaver interface
+     * Currently, only for X
+     */
+#ifdef HAVE_X11_XLIB_H
+    if( config_GetInt( p_vlc, "disable-screensaver" ) == 1 )
+    {
+        VLC_AddIntf( 0, "screensaver", VLC_FALSE, VLC_FALSE );
+    }
+#endif
+
     /*
      * FIXME: kludge to use a p_vlc-local variable for the Mozilla plugin
      */
index e3926c1d4bf92082700fd6d46b4212326a5817f2..8bbfb85d65ceb685e906410180d159725f02de41 100644 (file)
@@ -250,6 +250,9 @@ static char *ppsz_align_descriptions[] =
 #define VIDEO_ON_TOP_LONGTEXT N_("Always place the video window on top of " \
     "other windows." )
 
+#define SS_TEXT N_("Disable screensaver")
+#define SS_LONGTEXT N_("Disable the screensaver during video playback." )
+
 #define VIDEO_DECO_TEXT N_("Window decorations")
 #define VIDEO_DECO_LONGTEXT N_( \
     "If this option is disabled, VLC will avoid creating window caption, " \
@@ -990,6 +993,8 @@ vlc_module_begin();
 #endif
     add_bool( "video-on-top", 0, NULL, VIDEO_ON_TOP_TEXT,
               VIDEO_ON_TOP_LONGTEXT, VLC_FALSE );
+    add_bool( "disable-screensaver", VLC_TRUE, NULL, SS_TEXT, SS_LONGTEXT,
+              VLC_TRUE );
 
     set_section( N_("Snapshot") , NULL );
     add_directory( "snapshot-path", NULL, NULL, SNAP_PATH_TEXT,