From: Gerd Moellmann Date: Tue, 5 Dec 2000 16:47:31 +0000 (+0000) Subject: Close the display. X-Git-Tag: emacs-pretest-21.0.93~208 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8a4f36cc75c9a66508f06a5cff393c2d993f9e25;p=emacs.git Close the display. (xim_close_dpy): Handle case that the display has been closed. --- diff --git a/src/ChangeLog b/src/ChangeLog index 996ac54d6bf..39b0f4f7fb4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2000-12-05 Gerd Moellmann + * xterm.c [USE_X_TOOLKIT]: Close the display. + (xim_close_dpy): Handle case that the display has been closed. + * xterm.c (x_destroy_window): Reset the frame's X window after destroying it. diff --git a/src/xterm.c b/src/xterm.c index 464f8c39489..da53834e08f 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -11263,14 +11263,26 @@ x_connection_closed (display, error_message) struct x_display_info *dpyinfo = x_display_info_for_display (display); Lisp_Object frame, tail; - /* Indicate that this display is dead. */ + /* 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 class to make-frame-on-display. -#if 0 /* Closing the display caused a bus error on OpenWindows. */ + 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 cicumvent it here. */ + #ifdef USE_X_TOOLKIT XtCloseDisplay (display); -#endif #endif + /* Indicate that this display is dead. */ if (dpyinfo) dpyinfo->display = 0; @@ -11658,11 +11670,13 @@ xim_close_dpy (dpyinfo) { #ifdef USE_XIM #ifdef HAVE_X11R6_XIM - XUnregisterIMInstantiateCallback (dpyinfo->display, dpyinfo->xrdb, - NULL, EMACS_CLASS, - xim_instantiate_callback, NULL); + if (dpyinfo->display) + XUnregisterIMInstantiateCallback (dpyinfo->display, dpyinfo->xrdb, + NULL, EMACS_CLASS, + xim_instantiate_callback, NULL); #endif /* not HAVE_X11R6_XIM */ - XCloseIM (dpyinfo->xim); + if (dpyinfo->display) + XCloseIM (dpyinfo->xim); dpyinfo->xim = NULL; XFree (dpyinfo->xim_styles); #endif /* USE_XIM */