]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't use a redisplay optimization in a certain case on ttys
authorGerd Möllmann <gerd@gnu.org>
Tue, 21 Jan 2025 17:31:10 +0000 (18:31 +0100)
committerEshel Yaron <me@eshelyaron.com>
Thu, 23 Jan 2025 10:24:44 +0000 (11:24 +0100)
* src/dispnew.c (is_tty_root_frame_with_visible_child): New function.
* src/dispextern.h: Declare it.
* src/xdisp.c (redisplay_internal): Don't use optimization 1 for tty root
frames with a visible child frame.

(cherry picked from commit 0fd5b2d146e3578820446aa69b30d93958d9b1a5)

src/dispextern.h
src/dispnew.c
src/xdisp.c

index 9284d3a99ee43d1443b9560d0390533acbc63695..ccf0aebd7c665b4ba3a0ca54e6e24209cd383cd2 100644 (file)
@@ -3953,6 +3953,7 @@ Lisp_Object frames_in_reverse_z_order (struct frame *f, bool visible);
 bool is_tty_frame (struct frame *f);
 bool is_tty_child_frame (struct frame *f);
 bool is_tty_root_frame (struct frame *f);
+bool is_tty_root_frame_with_visible_child (struct frame *f);
 void combine_updates (Lisp_Object root_frames);
 void combine_updates_for_frame (struct frame *f, bool inhibit_id_p);
 void tty_raise_lower_frame (struct frame *f, bool raise);
index c3c8b1123b7ef0c9c032abff48ccd04750504903..ff413fab574031d1872b98039f1d8b0219595d95 100644 (file)
@@ -3476,6 +3476,18 @@ is_tty_root_frame (struct frame *f)
   return !FRAME_PARENT_FRAME (f) && is_tty_frame (f);
 }
 
+/* Return true if frame F is a tty root frame that has a visible child
+   frame..  */
+
+bool
+is_tty_root_frame_with_visible_child (struct frame *f)
+{
+  if (!is_tty_root_frame (f))
+    return false;
+  Lisp_Object z_order = frames_in_reverse_z_order (f, true);
+  return CONSP (XCDR (z_order));
+}
+
 /* Return the index of the first enabled row in MATRIX, or -1 if there
    is none.  */
 
index 73e96bd45d7a4533c281157852dc5570c1b9e6ca..51b0ecf040515d0c81a6a71cdbddf9905e75c958 100644 (file)
@@ -17279,7 +17279,11 @@ redisplay_internal (void)
                 line and this line is the current one, because
                 display_line above is not informed about the
                 current-line's vpos, and cannot DTRT in that case.  */
-             && !hscrolling_current_line_p (w))
+             && !hscrolling_current_line_p (w)
+             /* A root frame may have visible children displayed in its
+                current matrix, so that we can't do the below with its
+                current matrix.  */
+             && !is_tty_root_frame_with_visible_child (it.f))
            {
              /* If this is not the window's last line, we must adjust
                 the charstarts of the lines below.  */