From 36941b32f3a3cd332b3adaf0cc8178177c2e9166 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dj=C3=A4rv?= Date: Thu, 3 Feb 2011 14:46:03 +0100 Subject: [PATCH] * xterm.c (x_connection_closed): Remove all calls that calls XSync. Fixes: debbugs:7949 --- src/ChangeLog | 5 +++++ src/xterm.c | 31 +++---------------------------- 2 files changed, 8 insertions(+), 28 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 74165302824..aee41f57ac2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-02-03 Jan Djärv + + * xterm.c (x_connection_closed): Remove all calls that calls + XSync (Bug#7949). + 2011-02-01 Eli Zaretskii * image.c (tiff_load): Avoid compiler warning in 2nd arg to diff --git a/src/xterm.c b/src/xterm.c index 936a5f6b24e..92612507903 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -7694,12 +7694,6 @@ x_connection_closed (Display *dpy, const char *error_message) strcpy (error_msg, error_message); handling_signal = 0; - /* Prevent being called recursively because of an error condition - below. Otherwise, we might end up with printing ``can't find per - display information'' in the recursive call instead of printing - the original message here. */ - x_catch_errors (dpy); - /* Inhibit redisplay while frames are being deleted. */ specbind (Qinhibit_redisplay, Qt); @@ -7742,26 +7736,9 @@ x_connection_closed (Display *dpy, const char *error_message) first place, so don't try to close it. */ if (dpyinfo) { -#ifdef USE_X_TOOLKIT - /* We have to close the display to inform Xt that it doesn't - exist anymore. If we don't, Xt will continue to wait for - events from the display. As a consequence, a sequence of - - M-x make-frame-on-display RET :1 RET - ...kill the new frame, so that we get an IO error... - M-x make-frame-on-display RET :1 RET - - will indefinitely wait in Xt for events for display `:1', - opened in the first call to make-frame-on-display. - - Closing the display is reported to lead to a bus error on - OpenWindows in certain situations. I suspect that is a bug - in OpenWindows. I don't know how to circumvent it here. */ - fatal_error_signal_hook = x_fatal_error_signal; - XtCloseDisplay (dpy); - fatal_error_signal_hook = NULL; -#endif /* USE_X_TOOLKIT */ - + /* We can not call XtCloseDisplay here because it calls XSync. + XSync inside the error handler apparently hangs Emacs. On + current Xt versions, this isn't needed either. */ #ifdef USE_GTK /* A long-standing GTK bug prevents proper disconnect handling (https://bugzilla.gnome.org/show_bug.cgi?id=85715). Once, @@ -7792,8 +7769,6 @@ For details, see etc/PROBLEMS.\n", } } - x_uncatch_errors (); - if (terminal_list == 0) { fprintf (stderr, "%s\n", error_msg); -- 2.39.5