summaryrefslogtreecommitdiff
path: root/src/xterm.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-02-04 20:24:09 +0000
committerRichard M. Stallman <rms@gnu.org>1996-02-04 20:24:09 +0000
commit8798977f71017d2b36c23b399223b08d07443ec9 (patch)
treed703b4eceaad6c7a07c1ee583edafa951f3eabd0 /src/xterm.c
parente7f43767ebb538e8673fc3691a628ef4875b358d (diff)
downloademacs-8798977f71017d2b36c23b399223b08d07443ec9.tar.gz
(x_connection_signal): Call x_connection_closed properly.
(x_connection_closed): Set FRAME_X_DISPLAY to 0. (x_destroy_window): Don't do any X operations if FRAME_X_DISPLAY is 0. (x_term_init): Use "" as 2nd arg to setlocale. (x_connection_signal): Don't stop polling. Don't mess with SIGALRM. Those were relics of the superseded Dec 19 change.
Diffstat (limited to 'src/xterm.c')
-rw-r--r--src/xterm.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/src/xterm.c b/src/xterm.c
index c0578905eed..091690e1d19 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -4515,6 +4515,10 @@ x_connection_closed (display, error_message)
if (_Xdebug)
abort ();
+ /* Indicate that this display is dead. */
+
+ dpyinfo->display = 0;
+
/* First delete frames whose minibuffers are on frames
that are on the dead display. */
FOR_EACH_FRAME (tail, frame)
@@ -4629,13 +4633,11 @@ x_connection_signal (signalnum) /* If we don't have an argument, */
{
x_connection_signal_dpyinfo = x_display_list;
- stop_polling ();
sigunblock (SIGPIPE);
while (x_connection_signal_dpyinfo)
{
signal (SIGPIPE, x_connection_signal_1);
- signal (SIGALRM, x_connection_signal_1);
#ifdef SOLARIS2
#ifdef XlibDisplayWriting
@@ -4643,8 +4645,11 @@ x_connection_signal (signalnum) /* If we don't have an argument, */
This assumes that the library does not make other threads
that can be locking the display legitimately. */
if (x_connection_signal_dpyinfo->display->flags & XlibDisplayWriting)
- x_connection_closed (x_connection_signal_dpyinfo,
- "connection was lost");
+ {
+ x_connection_signal_dpyinfo->display->flags &= ~XlibDisplayWriting;
+ x_connection_closed (x_connection_signal_dpyinfo->display,
+ "connection was lost");
+ }
#endif
#endif
@@ -5539,16 +5544,21 @@ x_destroy_window (f)
BLOCK_INPUT;
- if (f->output_data.x->icon_desc != 0)
- XDestroyWindow (FRAME_X_DISPLAY (f), f->output_data.x->icon_desc);
- XDestroyWindow (FRAME_X_DISPLAY (f), f->output_data.x->window_desc);
+ /* If a display connection is dead, don't try sending more
+ commands to the X server. */
+ if (dpyinfo->display != 0)
+ {
+ if (f->output_data.x->icon_desc != 0)
+ XDestroyWindow (FRAME_X_DISPLAY (f), f->output_data.x->icon_desc);
+ XDestroyWindow (FRAME_X_DISPLAY (f), f->output_data.x->window_desc);
#ifdef USE_X_TOOLKIT
- XtDestroyWidget (f->output_data.x->widget);
- free_frame_menubar (f);
+ XtDestroyWidget (f->output_data.x->widget);
+ free_frame_menubar (f);
#endif /* USE_X_TOOLKIT */
- free_frame_faces (f);
- XFlush (FRAME_X_DISPLAY (f));
+ free_frame_faces (f);
+ XFlush (FRAME_X_DISPLAY (f));
+ }
xfree (f->output_data.x);
f->output_data.x = 0;
@@ -5862,7 +5872,7 @@ x_term_init (display_name, xrm_option, resource_name)
}
#ifdef HAVE_X_I18N
- setlocale (LC_ALL, NULL);
+ setlocale (LC_ALL, "");
#endif
#ifdef USE_X_TOOLKIT