ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/sundev.c
(Generate patch)

Comparing ray/src/rt/sundev.c (file contents):
Revision 1.2 by greg, Sat Apr 15 09:49:24 1989 UTC vs.
Revision 1.3 by greg, Mon Apr 17 10:08:14 1989 UTC

# Line 70 | Line 70 | char   *argv[];
70          char    *ttyargv[4], arg1[10], arg2[10];
71          int     pd[2];
72          int     com;
73        register Pixwin *pw;
73  
74          progname = argv[0];
75  
# Line 141 | Line 140 | Frame  fr;
140   Destroy_status  st;
141   {
142          if (st != DESTROY_CHECKING) {
143 <                kill((int)window_get(tty, TTY_PID), SIGHUP);
144 <                kill(getppid(), SIGHUP);
143 >                kill((int)window_get(tty, TTY_PID), SIGPIPE);
144 >                kill(getppid(), SIGPIPE);
145          }
146          return(notify_next_destroy_func(fr, st));
147   }
# Line 221 | Line 220 | sun_comin()                    /* input a string from the command line
220  
221   sun_getcur()                    /* get cursor position */
222   {
223 <        Event   *ep;
223 >        Event   ev;
224          int     xpos, ypos;
225          int     c;
226  
227          notify_no_dispatch();                   /* allow read to block */
228          window_set(canvas, WIN_CONSUME_KBD_EVENT, WIN_ASCII_EVENTS, 0);
229 <        while (window_read_event(canvas, ep) == 0) {
230 <                switch (event_id(ep)) {
231 <                case MS_LEFT:
232 <                case MB1:
233 <                        c = MB1;
234 <                        break;
235 <                case MS_MIDDLE:
236 <                case MB2:
237 <                        c = MB2;
239 <                        break;
240 <                case MS_RIGHT:
241 <                case MB3:
242 <                        c = MB3;
243 <                        break;
244 <                case ABORT:
245 <                        c = ABORT;
246 <                        break;
247 <                default:
248 <                        continue;
249 <                }
250 <                xpos = event_x(ep);
251 <                ypos = yres-1 - event_y(ep);
229 > again:
230 >        if (window_read_event(canvas, &ev) == -1) {
231 >                notify_perror();
232 >                quit("window event read error");
233 >        }
234 >        c = event_id(&ev);
235 >        switch (c) {
236 >        case MS_LEFT:
237 >                c = MB1;
238                  break;
239 +        case MS_MIDDLE:
240 +                c = MB2;
241 +                break;
242 +        case MS_RIGHT:
243 +                c = MB3;
244 +                break;
245 +        default:
246 +                if (c < ASCII_FIRST || c > ASCII_LAST)
247 +                        goto again;
248 +                break;
249          }
250 +        xpos = event_x(&ev);
251 +        ypos = yres-1 - event_y(&ev);
252 +
253          window_set(canvas, WIN_IGNORE_KBD_EVENT, WIN_ASCII_EVENTS, 0);
254          notify_do_dispatch();
255          putc(COM_GETCUR, stdout);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines