diff options
| -rw-r--r-- | src/xterm.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/src/xterm.c b/src/xterm.c index 7d5cd5a5de9..e942938d861 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -347,6 +347,11 @@ static short grey_bits[] = { | |||
| 347 | static Pixmap GreyPixmap = 0; | 347 | static Pixmap GreyPixmap = 0; |
| 348 | #endif /* ! defined (HAVE_X11) */ | 348 | #endif /* ! defined (HAVE_X11) */ |
| 349 | 349 | ||
| 350 | #ifdef X_IO_BUG | ||
| 351 | static int x_noop_count; | ||
| 352 | #endif | ||
| 353 | |||
| 354 | |||
| 350 | /* From time to time we get info on an Emacs window, here. */ | 355 | /* From time to time we get info on an Emacs window, here. */ |
| 351 | 356 | ||
| 352 | static WINDOWINFO_TYPE windowinfo; | 357 | static WINDOWINFO_TYPE windowinfo; |
| @@ -4310,10 +4315,20 @@ XTread_socket (sd, bufp, numchars, waitp, expected) | |||
| 4310 | } | 4315 | } |
| 4311 | 4316 | ||
| 4312 | #ifdef X_IO_BUG | 4317 | #ifdef X_IO_BUG |
| 4313 | if (! event_found) | 4318 | if (! event_found) |
| 4314 | /* On some systems, an X bug causes Emacs to get no more events | 4319 | { |
| 4315 | when the window is destroyed. Detect that. (1994.) */ | 4320 | /* On some systems, an X bug causes Emacs to get no more events |
| 4316 | XNoOp (x_current_display); | 4321 | when the window is destroyed. Detect that. (1994.) */ |
| 4322 | /* Emacs and the X Server eats up CPU time if XNoOp is done every time. | ||
| 4323 | One XNOOP in 100 loops will make Emacs terminate. | ||
| 4324 | B. Bretthauer, 1994 */ | ||
| 4325 | x_noop_count++; | ||
| 4326 | if (x_noop_count >= 100) | ||
| 4327 | { | ||
| 4328 | x_noop_count=0; | ||
| 4329 | XNoOp (x_current_display); | ||
| 4330 | } | ||
| 4331 | } | ||
| 4317 | #endif /* X_IO_BUG */ | 4332 | #endif /* X_IO_BUG */ |
| 4318 | 4333 | ||
| 4319 | #if 0 /* This fails for serial-line connections to the X server, | 4334 | #if 0 /* This fails for serial-line connections to the X server, |
| @@ -6078,6 +6093,10 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 6078 | #endif /* ! defined (F_SETOWN) */ | 6093 | #endif /* ! defined (F_SETOWN) */ |
| 6079 | #endif /* F_SETOWN_BUG */ | 6094 | #endif /* F_SETOWN_BUG */ |
| 6080 | 6095 | ||
| 6096 | #ifdef X_IO_BUG | ||
| 6097 | x_noop_count = 0; | ||
| 6098 | #endif | ||
| 6099 | |||
| 6081 | x_focus_frame = x_highlight_frame = 0; | 6100 | x_focus_frame = x_highlight_frame = 0; |
| 6082 | 6101 | ||
| 6083 | #ifdef USE_X_TOOLKIT | 6102 | #ifdef USE_X_TOOLKIT |