* 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)
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);
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. */
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. */