diff options
| -rw-r--r-- | src/sysdep.c | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/src/sysdep.c b/src/sysdep.c index 96f857432a8..5ede3d27208 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -2614,13 +2614,6 @@ sys_select (nfds, rfds, wfds, efds, timeout) | |||
| 2614 | /* Read keyboard input into the standard buffer, | 2614 | /* Read keyboard input into the standard buffer, |
| 2615 | waiting for at least one character. */ | 2615 | waiting for at least one character. */ |
| 2616 | 2616 | ||
| 2617 | /* Make all keyboard buffers much bigger when using a window system. */ | ||
| 2618 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 2619 | #define BUFFER_SIZE_FACTOR 16 | ||
| 2620 | #else | ||
| 2621 | #define BUFFER_SIZE_FACTOR 1 | ||
| 2622 | #endif | ||
| 2623 | |||
| 2624 | void | 2617 | void |
| 2625 | read_input_waiting () | 2618 | read_input_waiting () |
| 2626 | { | 2619 | { |
| @@ -2629,26 +2622,19 @@ read_input_waiting () | |||
| 2629 | 2622 | ||
| 2630 | if (read_socket_hook) | 2623 | if (read_socket_hook) |
| 2631 | { | 2624 | { |
| 2632 | struct input_event buf[256]; | 2625 | struct input_event hold_quit; |
| 2633 | for (i = 0; i < 256; i++) | 2626 | |
| 2634 | EVENT_INIT (buf[i]); | 2627 | EVENT_INIT (hold_quit); |
| 2635 | 2628 | hold_quit.kind = NO_EVENT; | |
| 2629 | |||
| 2636 | read_alarm_should_throw = 0; | 2630 | read_alarm_should_throw = 0; |
| 2637 | if (! setjmp (read_alarm_throw)) | 2631 | if (! setjmp (read_alarm_throw)) |
| 2638 | nread = (*read_socket_hook) (0, buf, 256, 1); | 2632 | nread = (*read_socket_hook) (0, 1, &hold_quit); |
| 2639 | else | 2633 | else |
| 2640 | nread = -1; | 2634 | nread = -1; |
| 2641 | 2635 | ||
| 2642 | /* Scan the chars for C-g and store them in kbd_buffer. */ | 2636 | if (hold_quit.kind != NO_EVENT) |
| 2643 | for (i = 0; i < nread; i++) | 2637 | kbd_buffer_store_event (&hold_quit); |
| 2644 | { | ||
| 2645 | kbd_buffer_store_event (&buf[i]); | ||
| 2646 | /* Don't look at input that follows a C-g too closely. | ||
| 2647 | This reduces lossage due to autorepeat on C-g. */ | ||
| 2648 | if (buf[i].kind == ASCII_KEYSTROKE_EVENT | ||
| 2649 | && buf[i].code == quit_char) | ||
| 2650 | break; | ||
| 2651 | } | ||
| 2652 | } | 2638 | } |
| 2653 | else | 2639 | else |
| 2654 | { | 2640 | { |