mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-27 15:52:00 -08:00
(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.
This commit is contained in:
parent
65df085181
commit
ef2a22d0bb
1 changed files with 23 additions and 4 deletions
27
src/xterm.c
27
src/xterm.c
|
|
@ -347,6 +347,11 @@ static short grey_bits[] = {
|
|||
static Pixmap GreyPixmap = 0;
|
||||
#endif /* ! defined (HAVE_X11) */
|
||||
|
||||
#ifdef X_IO_BUG
|
||||
static int x_noop_count;
|
||||
#endif
|
||||
|
||||
|
||||
/* From time to time we get info on an Emacs window, here. */
|
||||
|
||||
static WINDOWINFO_TYPE windowinfo;
|
||||
|
|
@ -4310,10 +4315,20 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
|
|||
}
|
||||
|
||||
#ifdef X_IO_BUG
|
||||
if (! event_found)
|
||||
/* On some systems, an X bug causes Emacs to get no more events
|
||||
when the window is destroyed. Detect that. (1994.) */
|
||||
XNoOp (x_current_display);
|
||||
if (! event_found)
|
||||
{
|
||||
/* On some systems, an X bug causes Emacs to get no more events
|
||||
when the window is destroyed. Detect that. (1994.) */
|
||||
/* Emacs and the X Server eats up CPU time if XNoOp is done every time.
|
||||
One XNOOP in 100 loops will make Emacs terminate.
|
||||
B. Bretthauer, 1994 */
|
||||
x_noop_count++;
|
||||
if (x_noop_count >= 100)
|
||||
{
|
||||
x_noop_count=0;
|
||||
XNoOp (x_current_display);
|
||||
}
|
||||
}
|
||||
#endif /* X_IO_BUG */
|
||||
|
||||
#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)
|
|||
#endif /* ! defined (F_SETOWN) */
|
||||
#endif /* F_SETOWN_BUG */
|
||||
|
||||
#ifdef X_IO_BUG
|
||||
x_noop_count = 0;
|
||||
#endif
|
||||
|
||||
x_focus_frame = x_highlight_frame = 0;
|
||||
|
||||
#ifdef USE_X_TOOLKIT
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue