changeset 92734:b0748b402e51

(x_connection_closed): For GTK: If this is the last terminal just exit without closing the display.
author Jan Djärv <jan.h.d@swipnet.se>
date Tue, 11 Mar 2008 07:35:09 +0000
parents 3180b0ea3766
children 6bdbc910d8ba
files src/xterm.c
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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