]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix a crash when an X connection is dropped in some situations
authorPo Lu <luangruo@yahoo.com>
Wed, 18 May 2022 01:07:41 +0000 (09:07 +0800)
committerPo Lu <luangruo@yahoo.com>
Wed, 18 May 2022 01:07:41 +0000 (09:07 +0800)
* src/xterm.c (x_flip_and_flush): Don't try to flush if
`inhibit-redisplay' is t.

src/xterm.c

index f81d99ca129f301c34ddb0f003b6d2b2ba59f81c..c24de0f185f680e64d397d4cfecb277109279bc3 100644 (file)
@@ -5618,6 +5618,12 @@ show_back_buffer (struct frame *f)
 static void
 x_flip_and_flush (struct frame *f)
 {
+  /* Flipping buffers requires a working connection to the X server,
+     which isn't always present if `inhibit-redisplay' is t, since
+     this can be called from the IO error handler.  */
+  if (!NILP (Vinhibit_redisplay))
+    return;
+
   block_input ();
 #ifdef HAVE_XDBE
   if (FRAME_X_NEED_BUFFER_FLIP (f))