aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaroly Lorentey2005-03-19 20:38:03 +0000
committerKaroly Lorentey2005-03-19 20:38:03 +0000
commit3dde89595b858eb67d926d80ac7c63dae398c8ae (patch)
treee67e4995a88c315d62f72d858ec0007a2a758b97 /src
parent392711ede18168618ac6eedd4fdf5910d11a2714 (diff)
downloademacs-3dde89595b858eb67d926d80ac7c63dae398c8ae.tar.gz
emacs-3dde89595b858eb67d926d80ac7c63dae398c8ae.zip
Close the X connection when the last frame is deleted.
* src/xfns.c (Fx_close_connection): Move code to x_delete_frame_display. (x_delete_frame_display): Actually close the X connection. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-312
Diffstat (limited to 'src')
-rw-r--r--src/xfns.c20
-rw-r--r--src/xterm.c23
2 files changed, 22 insertions, 21 deletions
diff --git a/src/xfns.c b/src/xfns.c
index 72547e2010f..2487e67be9c 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -4051,25 +4051,7 @@ If DISPLAY is nil, that stands for the selected frame's display. */)
4051 if (dpyinfo->reference_count > 0) 4051 if (dpyinfo->reference_count > 0)
4052 error ("Display still has frames on it"); 4052 error ("Display still has frames on it");
4053 4053
4054 BLOCK_INPUT; 4054 x_delete_frame_display (dpyinfo->frame_display);
4055 /* Free the fonts in the font table. */
4056 for (i = 0; i < dpyinfo->n_fonts; i++)
4057 if (dpyinfo->font_table[i].name)
4058 {
4059 XFreeFont (dpyinfo->display, dpyinfo->font_table[i].font);
4060 }
4061
4062 x_destroy_all_bitmaps (dpyinfo);
4063 XSetCloseDownMode (dpyinfo->display, DestroyAll);
4064
4065#ifdef USE_X_TOOLKIT
4066 XtCloseDisplay (dpyinfo->display);
4067#else
4068 XCloseDisplay (dpyinfo->display);
4069#endif
4070
4071 x_delete_display (dpyinfo);
4072 UNBLOCK_INPUT;
4073 4055
4074 return Qnil; 4056 return Qnil;
4075} 4057}
diff --git a/src/xterm.c b/src/xterm.c
index 2fd9e6b99e6..36f1630e6c1 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -10767,8 +10767,27 @@ static struct redisplay_interface x_redisplay_interface =
10767void 10767void
10768x_delete_frame_display (struct display *display) 10768x_delete_frame_display (struct display *display)
10769{ 10769{
10770 /* We don't do anything, the connection to the X server must remain 10770 struct x_display_info *dpyinfo = display->display_info;
10771 open. */ 10771
10772 BLOCK_INPUT;
10773 /* Free the fonts in the font table. */
10774 for (i = 0; i < dpyinfo->n_fonts; i++)
10775 if (dpyinfo->font_table[i].name)
10776 {
10777 XFreeFont (dpyinfo->display, dpyinfo->font_table[i].font);
10778 }
10779
10780 x_destroy_all_bitmaps (dpyinfo);
10781 XSetCloseDownMode (dpyinfo->display, DestroyAll);
10782
10783#ifdef USE_X_TOOLKIT
10784 XtCloseDisplay (dpyinfo->display);
10785#else
10786 XCloseDisplay (dpyinfo->display);
10787#endif
10788
10789 x_delete_display (dpyinfo);
10790 UNBLOCK_INPUT;
10772} 10791}
10773 10792
10774 10793