diff options
| author | Dmitry Antipov | 2013-12-12 08:04:35 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2013-12-12 08:04:35 +0400 |
| commit | 9654230233e49cf93e6a8f38685e4b809f02789e (patch) | |
| tree | 395daadf5e366adcf59864c230fa0c39985bd22e /src | |
| parent | f54de22e65df1f0f0345efce4d6fd3487d0f7bb5 (diff) | |
| download | emacs-9654230233e49cf93e6a8f38685e4b809f02789e.tar.gz emacs-9654230233e49cf93e6a8f38685e4b809f02789e.zip | |
* xterm.c (x_make_frame_visible): Restore hack which is needed when
input polling is used. This is still meaningful for Cygwin, see
http://lists.gnu.org/archive/html/emacs-devel/2013-12/msg00351.html.
* keyboard.c (poll_for_input_1, input_polling_used): Define
unconditionally.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/keyboard.c | 5 | ||||
| -rw-r--r-- | src/xterm.c | 21 |
3 files changed, 29 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 89c640bd8c7..60258810fe2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2013-12-12 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | * xterm.c (x_make_frame_visible): Restore hack which is needed when | ||
| 4 | input polling is used. This is still meaningful for Cygwin, see | ||
| 5 | http://lists.gnu.org/archive/html/emacs-devel/2013-12/msg00351.html. | ||
| 6 | * keyboard.c (poll_for_input_1, input_polling_used): Define | ||
| 7 | unconditionally. | ||
| 8 | |||
| 1 | 2013-12-11 Ken Brown <kbrown@cornell.edu> | 9 | 2013-12-11 Ken Brown <kbrown@cornell.edu> |
| 2 | 10 | ||
| 3 | * dispextern.h (erase_phys_cursor): | 11 | * dispextern.h (erase_phys_cursor): |
diff --git a/src/keyboard.c b/src/keyboard.c index 913a277ca79..915ce9dcf23 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -1954,7 +1954,6 @@ int poll_suppress_count; | |||
| 1954 | 1954 | ||
| 1955 | static struct atimer *poll_timer; | 1955 | static struct atimer *poll_timer; |
| 1956 | 1956 | ||
| 1957 | #ifdef HAVE_NTGUI | ||
| 1958 | /* Poll for input, so that we catch a C-g if it comes in. */ | 1957 | /* Poll for input, so that we catch a C-g if it comes in. */ |
| 1959 | void | 1958 | void |
| 1960 | poll_for_input_1 (void) | 1959 | poll_for_input_1 (void) |
| @@ -1963,7 +1962,6 @@ poll_for_input_1 (void) | |||
| 1963 | && !waiting_for_input) | 1962 | && !waiting_for_input) |
| 1964 | gobble_input (); | 1963 | gobble_input (); |
| 1965 | } | 1964 | } |
| 1966 | #endif | ||
| 1967 | 1965 | ||
| 1968 | /* Timer callback function for poll_timer. TIMER is equal to | 1966 | /* Timer callback function for poll_timer. TIMER is equal to |
| 1969 | poll_timer. */ | 1967 | poll_timer. */ |
| @@ -2015,8 +2013,6 @@ start_polling (void) | |||
| 2015 | #endif | 2013 | #endif |
| 2016 | } | 2014 | } |
| 2017 | 2015 | ||
| 2018 | #ifdef HAVE_NTGUI | ||
| 2019 | |||
| 2020 | /* True if we are using polling to handle input asynchronously. */ | 2016 | /* True if we are using polling to handle input asynchronously. */ |
| 2021 | 2017 | ||
| 2022 | bool | 2018 | bool |
| @@ -2031,7 +2027,6 @@ input_polling_used (void) | |||
| 2031 | return 0; | 2027 | return 0; |
| 2032 | #endif | 2028 | #endif |
| 2033 | } | 2029 | } |
| 2034 | #endif | ||
| 2035 | 2030 | ||
| 2036 | /* Turn off polling. */ | 2031 | /* Turn off polling. */ |
| 2037 | 2032 | ||
diff --git a/src/xterm.c b/src/xterm.c index 2c5c01baa84..8498382511b 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -8923,6 +8923,27 @@ x_make_frame_visible (struct frame *f) | |||
| 8923 | { | 8923 | { |
| 8924 | /* Force processing of queued events. */ | 8924 | /* Force processing of queued events. */ |
| 8925 | x_sync (f); | 8925 | x_sync (f); |
| 8926 | |||
| 8927 | /* This hack is still in use at least for Cygwin. See | ||
| 8928 | http://lists.gnu.org/archive/html/emacs-devel/2013-12/msg00351.html. | ||
| 8929 | |||
| 8930 | Machines that do polling rather than SIGIO have been | ||
| 8931 | observed to go into a busy-wait here. So we'll fake an | ||
| 8932 | alarm signal to let the handler know that there's something | ||
| 8933 | to be read. We used to raise a real alarm, but it seems | ||
| 8934 | that the handler isn't always enabled here. This is | ||
| 8935 | probably a bug. */ | ||
| 8936 | if (input_polling_used ()) | ||
| 8937 | { | ||
| 8938 | /* It could be confusing if a real alarm arrives while | ||
| 8939 | processing the fake one. Turn it off and let the | ||
| 8940 | handler reset it. */ | ||
| 8941 | int old_poll_suppress_count = poll_suppress_count; | ||
| 8942 | poll_suppress_count = 1; | ||
| 8943 | poll_for_input_1 (); | ||
| 8944 | poll_suppress_count = old_poll_suppress_count; | ||
| 8945 | } | ||
| 8946 | |||
| 8926 | if (XPending (FRAME_X_DISPLAY (f))) | 8947 | if (XPending (FRAME_X_DISPLAY (f))) |
| 8927 | { | 8948 | { |
| 8928 | XEvent xev; | 8949 | XEvent xev; |