My Hackergotchi

Updated: Never — Philip's Blog

Now featuring regular updates!

Sun, 13 Jul 2008

22:10 – MIT-SCREEN-SAVER

Found in vlc (modules/misc/screensaver.c - GPL) after I found gnome-screensaver-command: not found on stderr once too often:

/*****************************************************************************
 * Run: main thread
 *****************************************************************************
 * This part of the module is in a separate thread so that we do not have
 * too much system() overhead.
 *****************************************************************************/
static void Run( intf_thread_t *p_intf )
{
    int i_lastcall = 0;

    while( !p_intf->b_die )
    {
        msleep( 100000 );

        /* Check screensaver every 30 seconds */
        if( ++i_lastcall > 300 )
        {
            vlc_object_t *p_vout;
            p_vout = vlc_object_find( p_intf, VLC_OBJECT_VOUT, FIND_ANYWHERE );
            /* If there is a video output, disable xscreensaver */
            if( p_vout )
            {
                vlc_object_release( p_vout );

                /* http://www.jwz.org/xscreensaver/faq.html#dvd */
                system( "xscreensaver-command -deactivate >&- 2>&- &" );
                system( "gnome-screensaver-command --poke >&- 2>&- &" );

                /* FIXME: add support for other screensavers */
            }

            i_lastcall = 0;
        }
    }
}

My eyes bleed... This is what the MIT-SCREEN-SAVER extension is for, Sam. If I can only figure out how to get at the Display pointer from p_intf, I'll send you a patch.

What do non-geeks do on Sunday evenings? Code-reading is fun.

Some non-geek Sunday evening activity suggestions:
* explore known and unknown beers at the local pub (with moderation because monday is a work day)
* going to the cinema with the mrs.
* read a book
* if there is still light outside: work a bit in the garden
* watch some telly. I've heard that Top Gear on auntie Beeb is fun, even for people who don't like cars.
* reproductional activities with your significant other
* do some washing and ironing

Just a few of the things that popped into my mind. You did expect an answer, or didn't you?

captcha: The Luggage

Posted by Amedee at Mon Jul 14 00:36:58 2008

Name:

Email:

URL:

Comment:


Prove that you are not a spammer: