Ignore:
Timestamp:
Jun 18, 2008 4:50:41 PM (6 years ago)
Author:
jylam
Message:
  • Made Screensaver Engine (called a glazillon times) cleaner
  • Set default screensaver timeout to 60 seconds
  • Don't send key event that caused screensaver to quit to active terminal
File:
1 edited

Legend:

Unmodified
Added
Removed
  • neercs/trunk/src/main.c

    r2447 r2448  
    122122    screen_list->pty = screen_list->prevpty = 0;
    123123    screen_list->dont_update_coords = 0;
    124     screen_list->screensaver_timeout = (10) * 1000000;
    125 
     124    screen_list->screensaver_timeout = (60) * 1000000;
     125    screen_list->screensaver_data = NULL;
     126    screen_list->in_screensaver = 0;
    126127
    127128    recurrent_list = (struct recurrent_list*) malloc(sizeof(struct recurrent_list));
     
    270271            else
    271272            {
     273
     274                last_key_time = get_ms();
     275                caca_set_cursor(dp, 1);
     276
     277                if(screen_list->in_screensaver)
     278                {
     279                    screensaver_kill(cv, dp, screen_list);
     280                    screen_list->in_screensaver = 0;
     281                    refresh = 1;
     282                    continue;
     283                }
     284
     285
    272286                switch(c)
    273287                {
     
    288302                }
    289303            }
    290             last_key_time = get_ms();
    291             caca_set_cursor(dp, 1);
    292304        }
    293305        else if(ret && (caca_get_event_type(&ev) & CACA_EVENT_RESIZE))
     
    332344        if((get_ms() - last_key_time > screen_list->screensaver_timeout))
    333345        {
     346            if(!screen_list->in_screensaver)
     347                screensaver_init(cv, dp, screen_list);
     348            screen_list->in_screensaver = 1;
     349
    334350            caca_set_cursor(dp, 0);
    335351            draw_screensaver(cv, dp, screen_list);
Note: See TracChangeset for help on using the changeset viewer.