--- ray/src/hd/rhdisp.c 1997/12/12 11:13:15 3.14 +++ ray/src/hd/rhdisp.c 1997/12/19 14:49:05 3.17 @@ -15,7 +15,7 @@ static char SCCSid[] = "$SunId$ SGI"; #include #ifndef VIEWHISTLEN -#define VIEWHISTLEN 2 /* number of remembered views */ +#define VIEWHISTLEN 4 /* number of remembered views */ #endif HOLO *hdlist[HDMAX+1]; /* global holodeck list */ @@ -64,20 +64,24 @@ char *argv[]; printview(); if (inp & DFL(DC_LASTVIEW)) new_view(NULL); - if (inp & DFL(DC_PAUSE)) - pause = 1; if (inp & DFL(DC_RESUME)) { serv_request(DR_NOOP, 0, NULL); pause = 0; } + if (inp & DFL(DC_PAUSE)) + pause = 1; if (inp & DFL(DC_REDRAW)) imm_mode = beam_sync() > 0; - if (inp & DFL(DC_KILL)) + if (inp & DFL(DC_KILL)) { serv_request(DR_KILL, 0, NULL); + pause = 0; + } if (inp & DFL(DC_CLOBBER)) serv_request(DR_CLOBBER, 0, NULL); - if (inp & DFL(DC_RESTART)) + if (inp & DFL(DC_RESTART)) { serv_request(DR_RESTART, 0, NULL); + pause = 0; + } if (inp & DFL(DC_QUIT)) serv_request(DR_SHUTDOWN, 0, NULL); } @@ -88,6 +92,9 @@ char *argv[]; break; case DC_RESUME: serv_request(DR_NOOP, 0, NULL); + /* fall through */ + case DC_KILL: + case DC_RESTART: pause = 0; break; } @@ -207,17 +214,18 @@ register VIEW *v; char *err; /* restore previous view? */ if (v == NULL) { - if (nhist < 2) { - error(COMMAND, "no previous view"); - return; - } - nhist--; /* get one before last setting */ + if (nhist > 1) /* get one before last setting */ + nhist--; + else /* else go to end of list */ + while (nhist < VIEWHISTLEN && viewhist[nhist].type) + nhist++; v = viewhist + ((nhist-1)%VIEWHISTLEN); - } else if ((err = setview(v)) != NULL) { + } else +again: + if ((err = setview(v)) != NULL) { error(COMMAND, err); return; } -again: if (v->type == VT_PAR) { error(COMMAND, "cannot handle parallel views"); return;