diff options
| author | Eli Zaretskii | 2012-11-17 20:00:16 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2012-11-17 20:00:16 +0200 |
| commit | cf2d22b874ca2df0072e32ee641e8efffe4abd6d (patch) | |
| tree | 1795142ec7861fc85c61adc90f03265b69041556 /src/nsterm.m | |
| parent | 3c4ca7155293ffc2d04708007131bcbc882d8913 (diff) | |
| parent | 6ad30855c02908fdd99d9b11943719e185e65ee3 (diff) | |
| download | emacs-cf2d22b874ca2df0072e32ee641e8efffe4abd6d.tar.gz emacs-cf2d22b874ca2df0072e32ee641e8efffe4abd6d.zip | |
Merge from trunk.
Diffstat (limited to 'src/nsterm.m')
| -rw-r--r-- | src/nsterm.m | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/nsterm.m b/src/nsterm.m index 7ba1608268b..3640ac0c5e8 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -31,6 +31,7 @@ GNUstep port and post-20 update by Adrian Robert (arobert@cogsci.ucsd.edu) | |||
| 31 | #include <config.h> | 31 | #include <config.h> |
| 32 | 32 | ||
| 33 | #include <math.h> | 33 | #include <math.h> |
| 34 | #include <pthread.h> | ||
| 34 | #include <sys/types.h> | 35 | #include <sys/types.h> |
| 35 | #include <time.h> | 36 | #include <time.h> |
| 36 | #include <signal.h> | 37 | #include <signal.h> |
| @@ -330,6 +331,8 @@ hold_event (struct input_event *event) | |||
| 330 | } | 331 | } |
| 331 | 332 | ||
| 332 | hold_event_q.q[hold_event_q.nr++] = *event; | 333 | hold_event_q.q[hold_event_q.nr++] = *event; |
| 334 | /* Make sure ns_read_socket is called, i.e. we have input. */ | ||
| 335 | raise (SIGIO); | ||
| 333 | } | 336 | } |
| 334 | 337 | ||
| 335 | static Lisp_Object | 338 | static Lisp_Object |
| @@ -3387,7 +3390,7 @@ ns_read_socket (struct terminal *terminal, struct input_event *hold_quit) | |||
| 3387 | if ([NSApp modalWindow] != nil) | 3390 | if ([NSApp modalWindow] != nil) |
| 3388 | return -1; | 3391 | return -1; |
| 3389 | 3392 | ||
| 3390 | if (hold_event_q.nr > 0) | 3393 | if (hold_event_q.nr > 0) |
| 3391 | { | 3394 | { |
| 3392 | int i; | 3395 | int i; |
| 3393 | for (i = 0; i < hold_event_q.nr; ++i) | 3396 | for (i = 0; i < hold_event_q.nr; ++i) |
| @@ -3502,7 +3505,7 @@ ns_select (int nfds, fd_set *readfds, fd_set *writefds, | |||
| 3502 | 3505 | ||
| 3503 | /* Inform fd_handler that select should be called */ | 3506 | /* Inform fd_handler that select should be called */ |
| 3504 | c = 'g'; | 3507 | c = 'g'; |
| 3505 | write (selfds[1], &c, 1); | 3508 | emacs_write (selfds[1], &c, 1); |
| 3506 | } | 3509 | } |
| 3507 | else if (nr == 0 && timeout) | 3510 | else if (nr == 0 && timeout) |
| 3508 | { | 3511 | { |
| @@ -3535,7 +3538,7 @@ ns_select (int nfds, fd_set *readfds, fd_set *writefds, | |||
| 3535 | if (nr > 0 && readfds) | 3538 | if (nr > 0 && readfds) |
| 3536 | { | 3539 | { |
| 3537 | c = 's'; | 3540 | c = 's'; |
| 3538 | write (selfds[1], &c, 1); | 3541 | emacs_write (selfds[1], &c, 1); |
| 3539 | } | 3542 | } |
| 3540 | unblock_input (); | 3543 | unblock_input (); |
| 3541 | 3544 | ||
| @@ -4112,8 +4115,6 @@ ns_term_init (Lisp_Object display_name) | |||
| 4112 | 4115 | ||
| 4113 | color_file = Fexpand_file_name (build_string ("rgb.txt"), | 4116 | color_file = Fexpand_file_name (build_string ("rgb.txt"), |
| 4114 | Fsymbol_value (intern ("data-directory"))); | 4117 | Fsymbol_value (intern ("data-directory"))); |
| 4115 | if (NILP (Ffile_readable_p (color_file))) | ||
| 4116 | fatal ("Could not find %s.\n", SDATA (color_file)); | ||
| 4117 | 4118 | ||
| 4118 | color_map = Fx_load_color_file (color_file); | 4119 | color_map = Fx_load_color_file (color_file); |
| 4119 | if (NILP (color_map)) | 4120 | if (NILP (color_map)) |
| @@ -4576,11 +4577,8 @@ not_in_argv (NSString *arg) | |||
| 4576 | 4577 | ||
| 4577 | FD_SET (selfds[0], &fds); | 4578 | FD_SET (selfds[0], &fds); |
| 4578 | result = select (selfds[0]+1, &fds, NULL, NULL, NULL); | 4579 | result = select (selfds[0]+1, &fds, NULL, NULL, NULL); |
| 4579 | if (result > 0) | 4580 | if (result > 0 && read (selfds[0], &c, 1) == 1 && c == 'g') |
| 4580 | { | 4581 | waiting = 0; |
| 4581 | read (selfds[0], &c, 1); | ||
| 4582 | if (c == 'g') waiting = 0; | ||
| 4583 | } | ||
| 4584 | } | 4582 | } |
| 4585 | else | 4583 | else |
| 4586 | { | 4584 | { |
| @@ -4620,8 +4618,8 @@ not_in_argv (NSString *arg) | |||
| 4620 | { | 4618 | { |
| 4621 | if (FD_ISSET (selfds[0], &readfds)) | 4619 | if (FD_ISSET (selfds[0], &readfds)) |
| 4622 | { | 4620 | { |
| 4623 | read (selfds[0], &c, 1); | 4621 | if (read (selfds[0], &c, 1) == 1 && c == 's') |
| 4624 | if (c == 's') waiting = 1; | 4622 | waiting = 1; |
| 4625 | } | 4623 | } |
| 4626 | else | 4624 | else |
| 4627 | { | 4625 | { |
| @@ -6696,7 +6694,7 @@ not_in_argv (NSString *arg) | |||
| 6696 | /* Events may come here even if the event loop is not running. | 6694 | /* Events may come here even if the event loop is not running. |
| 6697 | If we don't enter the event loop, the scroll bar will not update. | 6695 | If we don't enter the event loop, the scroll bar will not update. |
| 6698 | So send SIGIO to ourselves. */ | 6696 | So send SIGIO to ourselves. */ |
| 6699 | if (apploopnr == 0) kill (0, SIGIO); | 6697 | if (apploopnr == 0) raise (SIGIO); |
| 6700 | 6698 | ||
| 6701 | return self; | 6699 | return self; |
| 6702 | } | 6700 | } |