changeset 1875:f569bc4e9b8f

* xterm.c (x_set_window_size): Call change_frame_size instead of just setting the `rows' and `cols' members of the frame, and leaving the window tree in complete disarray. * xterm.c (x_io_error_quitter): New function. (x_error_quitter): Note that this is only used for protocol errors now, not I/O errors. (x_term_init): Set the I/O error handler to x_io_error_quitter.
author Jim Blandy <jimb@redhat.com>
date Sun, 14 Feb 1993 14:40:55 +0000
parents 19cf50641d6c
children 0ddafa88e654
files src/xterm.c
diffstat 1 files changed, 22 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/xterm.c	Sun Feb 14 14:40:13 1993 +0000
+++ b/src/xterm.c	Sun Feb 14 14:40:55 1993 +0000
@@ -3557,9 +3557,9 @@
   exit (70);
 }
 
-/* An X error handler which prints an error message and then kills Emacs.  
-   This is what's normally installed as Xlib's handler for protocol and 
-   I/O errors.  */
+/* An X error handler which prints an error message and then kills
+   Emacs.  This is what's normally installed as Xlib's handler for
+   protocol errors.  */
 static int
 x_error_quitter (display, error)
      Display *display;
@@ -3581,6 +3581,23 @@
   x_connection_closed ();
 }
 
+/* A handler for X IO errors which prints an error message and then
+   kills Emacs.  This is what is always installed as Xlib's handler
+   for I/O errors.  */
+static int
+x_io_error_quitter (display)
+     Display *display;
+{
+  fprintf (stderr, "Connection to X server %s lost.\n",
+	   XDisplayName (DisplayString (display)));
+
+  /* While we're testing Emacs 19, we'll just dump core whenever we
+     get an X error, so we can figure out why it happened.  */
+  abort ();
+
+  x_connection_closed ();
+}
+
 /* A buffer for storing X error messages.  */
 static char (*x_caught_error_message)[200];
 
@@ -3873,8 +3890,7 @@
      might be kind of confusing to the lisp code, since size changes
      wouldn't be reported in the frame parameters until some random
      point in the future when the ConfigureNotify event arrives.  */
-  FRAME_WIDTH (f) = cols;
-  FRAME_HEIGHT (f) = rows;
+  change_frame_size (f, rows, cols, 0, 0);
   PIXEL_WIDTH (f) = pixelwidth;
   PIXEL_HEIGHT (f) = pixelheight;
 
@@ -4506,7 +4522,7 @@
   /* Note that there is no real way portable across R3/R4 to get the 
      original error handler.  */
   XHandleError (x_error_quitter);
-  XHandleIOError (x_error_quitter);
+  XHandleIOError (x_io_error_quitter);
 
   /* Disable Window Change signals;  they are handled by X events. */
 #ifdef SIGWINCH