Changeset 4055 for neercs


Ignore:
Timestamp:
Nov 28, 2009, 2:02:57 AM (10 years ago)
Author:
Pascal Terjan
Message:
  • Don't forget to refresh after we skipped
Location:
neercs/trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • neercs/trunk/src/neercs.h

    r4048 r4055  
    164164    int delay;                   /* Minimal time between two refresh (ms) */
    165165    int force_refresh;
     166    int need_refresh;            /* If we skipped a refresh, do it next time */
    166167    int command;
    167168    long long unsigned int last_key_time;
  • neercs/trunk/src/screen_list.c

    r4054 r4055  
    9292    screen_list->attach = 0;
    9393    screen_list->forceattach = 0;
    94    
     94    screen_list->need_refresh = 0;
     95
    9596    screen_list->force_refresh = 0;
    9697    screen_list->cube.in_switch = 0;
  • neercs/trunk/src/server.c

    r4053 r4055  
    3737
    3838static void server_init(struct screen_list *screen_list);
    39 static int refresh_screen(struct screen_list *screen_list, int refresh);
     39static void refresh_screen(struct screen_list *screen_list, int refresh);
    4040static int handle_key(struct screen_list *screen_list, unsigned int c,
    4141                      int refresh);
     
    207207{
    208208    int i;
    209     int eof = 0, refresh = 0;
     209    int eof = 0, refresh;
    210210
    211211    int quit = 0;
     
    214214   
    215215    /* Read program output */
    216     refresh |= update_screens_contents(screen_list);
     216    refresh = update_screens_contents(screen_list);
    217217   
    218218    /* Check if we got something from the client */
     
    272272   
    273273    /* Refresh screen */
    274     refresh |= refresh_screen(screen_list, refresh);
     274    refresh_screen(screen_list, refresh);
    275275   
    276276    eof = 1;
     
    313313}
    314314
    315 static int refresh_screen(struct screen_list *screen_list, int refresh)
     315static void refresh_screen(struct screen_list *screen_list, int refresh)
    316316{
    317317    if (!screen_list->attached)
     
    327327            (current_time - screen_list->last_refresh_time) / 1000;
    328328
     329        refresh |= screen_list->need_refresh;
     330
    329331        if (screen_list->force_refresh)
    330332        {
     
    336338        if (screen_list->locked)
    337339        {
     340            /* FIXME don't redraw it each iteration */
    338341            draw_lock(screen_list);
    339342            refresh = 1;
     
    372375                request_refresh(screen_list);
    373376                screen_list->last_refresh_time = current_time;
     377                screen_list->need_refresh = 0;
    374378            }
    375379            else
     
    377381                debug("Skipping refresh (%lld < %d)", tdiff,
    378382                      screen_list->delay);
     383                screen_list->need_refresh = 1;
    379384            }
    380385        }
    381386    }
    382 
    383     return 1;
    384387}
    385388
Note: See TracChangeset for help on using the changeset viewer.