aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2000-12-05 16:47:31 +0000
committerGerd Moellmann2000-12-05 16:47:31 +0000
commit8a4f36cc75c9a66508f06a5cff393c2d993f9e25 (patch)
tree98b7da9fc3957958df241214cacf97b44839374d
parent57d6e3818bf4b793fcf52e436ce8eb2f339809e8 (diff)
downloademacs-8a4f36cc75c9a66508f06a5cff393c2d993f9e25.tar.gz
emacs-8a4f36cc75c9a66508f06a5cff393c2d993f9e25.zip
Close the display.
(xim_close_dpy): Handle case that the display has been closed.
-rw-r--r--src/ChangeLog3
-rw-r--r--src/xterm.c28
2 files changed, 24 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 996ac54d6bf..39b0f4f7fb4 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,8 @@
12000-12-05 Gerd Moellmann <gerd@gnu.org> 12000-12-05 Gerd Moellmann <gerd@gnu.org>
2 2
3 * xterm.c [USE_X_TOOLKIT]: Close the display.
4 (xim_close_dpy): Handle case that the display has been closed.
5
3 * xterm.c (x_destroy_window): Reset the frame's X window after 6 * xterm.c (x_destroy_window): Reset the frame's X window after
4 destroying it. 7 destroying it.
5 8
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)
11263 struct x_display_info *dpyinfo = x_display_info_for_display (display); 11263 struct x_display_info *dpyinfo = x_display_info_for_display (display);
11264 Lisp_Object frame, tail; 11264 Lisp_Object frame, tail;
11265 11265
11266 /* Indicate that this display is dead. */ 11266 /* We have to close the display to inform Xt that it doesn't
11267 exist anymore. If we don't, Xt will continue to wait for
11268 events from the display. As a consequence, a sequence of
11269
11270 M-x make-frame-on-display RET :1 RET
11271 ...kill the new frame, so that we get an IO error...
11272 M-x make-frame-on-display RET :1 RET
11273
11274 will indefinitely wait in Xt for events for display `:1', opened
11275 in the first class to make-frame-on-display.
11267 11276
11268#if 0 /* Closing the display caused a bus error on OpenWindows. */ 11277 Closing the display is reported to lead to a bus error on
11278 OpenWindows in certain situations. I suspect that is a bug
11279 in OpenWindows. I don't know how to cicumvent it here. */
11280
11269#ifdef USE_X_TOOLKIT 11281#ifdef USE_X_TOOLKIT
11270 XtCloseDisplay (display); 11282 XtCloseDisplay (display);
11271#endif 11283#endif
11272#endif
11273 11284
11285 /* Indicate that this display is dead. */
11274 if (dpyinfo) 11286 if (dpyinfo)
11275 dpyinfo->display = 0; 11287 dpyinfo->display = 0;
11276 11288
@@ -11658,11 +11670,13 @@ xim_close_dpy (dpyinfo)
11658{ 11670{
11659#ifdef USE_XIM 11671#ifdef USE_XIM
11660#ifdef HAVE_X11R6_XIM 11672#ifdef HAVE_X11R6_XIM
11661 XUnregisterIMInstantiateCallback (dpyinfo->display, dpyinfo->xrdb, 11673 if (dpyinfo->display)
11662 NULL, EMACS_CLASS, 11674 XUnregisterIMInstantiateCallback (dpyinfo->display, dpyinfo->xrdb,
11663 xim_instantiate_callback, NULL); 11675 NULL, EMACS_CLASS,
11676 xim_instantiate_callback, NULL);
11664#endif /* not HAVE_X11R6_XIM */ 11677#endif /* not HAVE_X11R6_XIM */
11665 XCloseIM (dpyinfo->xim); 11678 if (dpyinfo->display)
11679 XCloseIM (dpyinfo->xim);
11666 dpyinfo->xim = NULL; 11680 dpyinfo->xim = NULL;
11667 XFree (dpyinfo->xim_styles); 11681 XFree (dpyinfo->xim_styles);
11668#endif /* USE_XIM */ 11682#endif /* USE_XIM */