88 |
|
printview(); |
89 |
|
if (inp & DFL(DC_LASTVIEW)) |
90 |
|
new_view(NULL); |
91 |
– |
if (inp & DFL(DC_RESUME)) { |
92 |
– |
serv_request(DR_NOOP, 0, NULL); |
93 |
– |
pause = 0; |
94 |
– |
} |
95 |
– |
if (inp & DFL(DC_PAUSE)) |
96 |
– |
pause = 1; |
97 |
– |
if (inp & DFL(DC_REDRAW)) |
98 |
– |
imm_mode = beam_sync(1) > 0; |
91 |
|
if (inp & DFL(DC_KILL)) { |
92 |
|
serv_request(DR_KILL, 0, NULL); |
93 |
|
pause = 0; |
98 |
|
serv_request(DR_RESTART, 0, NULL); |
99 |
|
pause = 0; |
100 |
|
} |
101 |
+ |
if (inp & DFL(DC_RESUME)) { |
102 |
+ |
serv_request(DR_NOOP, 0, NULL); |
103 |
+ |
pause = 0; |
104 |
+ |
} |
105 |
+ |
if (inp & DFL(DC_PAUSE)) |
106 |
+ |
pause = 1; |
107 |
+ |
if (inp & DFL(DC_REDRAW)) |
108 |
+ |
imm_mode = beam_sync(1) > 0; |
109 |
|
if (inp & DFL(DC_QUIT)) |
110 |
|
serv_request(DR_SHUTDOWN, 0, NULL); |
111 |
|
} |
112 |
< |
if (rdy & RDY_SIN) /* user input from sstdin */ |
112 |
> |
if (rdy & RDY_SIN && !imm_mode) /* user input from sstdin */ |
113 |
|
switch (usr_input()) { |
114 |
|
case DC_PAUSE: |
115 |
|
pause = 1; |
289 |
|
} |
290 |
|
copystruct(v, viewhist + ((nhist-1)%VIEWHISTLEN)); |
291 |
|
goto again; |
292 |
< |
} |
293 |
< |
beam_sync(0); /* update server */ |
292 |
> |
} |
293 |
> |
/* update server */ |
294 |
> |
imm_mode = beam_sync(0) > 0; |
295 |
|
/* record new view */ |
296 |
|
if (v < viewhist || v >= viewhist+VIEWHISTLEN) { |
297 |
|
copystruct(viewhist + (nhist%VIEWHISTLEN), v); |
422 |
|
case DS_STARTIMM: |
423 |
|
case DS_ENDIMM: |
424 |
|
#ifdef DEBUG |
425 |
< |
if (imm_mode != (msg.type==DS_STARTIMM)) { |
425 |
> |
{ |
426 |
|
time_t tnow = time(NULL); |
427 |
< |
if (imm_mode) timm += tnow - tmodesw; |
428 |
< |
else tadd += tnow - tmodesw; |
427 |
> |
if (msg.type==DS_STARTIMM) tadd += tnow - tmodesw; |
428 |
> |
else timm += tnow - tmodesw; |
429 |
|
tmodesw = tnow; |
430 |
|
} |
431 |
|
#endif |
432 |
< |
imm_mode = msg.type==DS_STARTIMM; |
432 |
> |
if (!(imm_mode = msg.type==DS_STARTIMM)) |
433 |
> |
dev_flush(); |
434 |
|
goto noargs; |
435 |
|
case DS_ACKNOW: |
436 |
|
case DS_SHUTDOWN: |
459 |
|
{ |
460 |
|
MSGHEAD msg; |
461 |
|
int m; |
462 |
+ |
/* consistency checks */ |
463 |
+ |
#ifdef DEBUG |
464 |
+ |
if (nbytes < 0 || nbytes > 0 & p == NULL) |
465 |
+ |
error(CONSISTENCY, "bad buffer handed to serv_request"); |
466 |
+ |
#endif |
467 |
|
/* get server's attention for big request */ |
468 |
|
if (nbytes >= BIGREQSIZ-sizeof(MSGHEAD)) { |
469 |
|
serv_request(DR_ATTEN, 0, NULL); |