aboutsummaryrefslogtreecommitdiffstats
path: root/src/xterm.c
diff options
context:
space:
mode:
authorRichard M. Stallman1994-06-15 20:15:59 +0000
committerRichard M. Stallman1994-06-15 20:15:59 +0000
commitef2a22d0bba8a4de98a52ebddae092632fb5c594 (patch)
treedf3c5a31da7b18fa8369f1344bf3f1a00bde6908 /src/xterm.c
parent65df085181285cfaa6138bf535894bb7aa087f05 (diff)
downloademacs-ef2a22d0bba8a4de98a52ebddae092632fb5c594.tar.gz
emacs-ef2a22d0bba8a4de98a52ebddae092632fb5c594.zip
(x_noop_count): New variable.
(x_term_init) [X_IO_BUG]: Init it. (XTread_socket) [X_IO_BUG]: Don't do XNoOp every time, just 1 in 100.
Diffstat (limited to 'src/xterm.c')
-rw-r--r--src/xterm.c27
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[] = {
347static Pixmap GreyPixmap = 0; 347static Pixmap GreyPixmap = 0;
348#endif /* ! defined (HAVE_X11) */ 348#endif /* ! defined (HAVE_X11) */
349 349
350#ifdef X_IO_BUG
351static 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
352static WINDOWINFO_TYPE windowinfo; 357static 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