# HG changeset patch # User Jan Dj¸«£rv # Date 1205220909 0 # Node ID b0748b402e5170cc90f64c11f6cab84a2348ff96 # Parent 3180b0ea37660d5aa8b12e1a254026f3a91b4435 (x_connection_closed): For GTK: If this is the last terminal just exit without closing the display. diff -r 3180b0ea3766 -r b0748b402e51 src/xterm.c --- a/src/xterm.c Tue Mar 11 04:36:26 2008 +0000 +++ b/src/xterm.c Tue Mar 11 07:35:09 2008 +0000 @@ -8110,7 +8110,7 @@ OpenWindows in certain situations. I suspect that is a bug in OpenWindows. I don't know how to circumvent it here. */ - if (dpyinfo) + if (dpyinfo && terminal_list->next_terminal != NULL) { #ifdef USE_X_TOOLKIT /* If DPYINFO is null, this means we didn't open the display @@ -8124,6 +8124,14 @@ #endif #ifdef USE_GTK + /* Due to bugs in some Gtk+ versions, just exit here if this + is the last display/terminal. */ + if (terminal_list->next_terminal == NULL) + { + fprintf (stderr, "%s\n", error_msg); + shut_down_emacs (0, 0, Qnil); + exit (70); + } xg_display_close (dpyinfo->display); #endif