]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix a FIXME In redisplay_internal
authorGerd Möllmann <gerd@gnu.org>
Tue, 12 Nov 2024 08:23:27 +0000 (09:23 +0100)
committerEshel Yaron <me@eshelyaron.com>
Mon, 23 Dec 2024 14:54:26 +0000 (15:54 +0100)
* src/xdisp.c (redisplay_internal): Compare root frames before
setting the frame garbaged.

(cherry picked from commit 37cdf2897ad51f45a228c86f5f12feeb284673df)

src/xdisp.c

index 7c69302df900e38cbcdfcd5c789471b8ce84cfa6..00db18577742cbbdaa79dace1a89f422870ca359 100644 (file)
@@ -17037,19 +17037,22 @@ redisplay_internal (void)
   if (face_change)
     windows_or_buffers_changed = 47;
 
-  /* FIXME: Can we do better for tty child frames?  It could be
-     a bit faster when we switch between child frames of the same
-     root frame.  OTOH, it's probably not a frequent use case.  */
+  struct frame *previous_frame;
   if ((FRAME_TERMCAP_P (sf) || FRAME_MSDOS_P (sf))
-      && FRAME_TTY (sf)->previous_frame != sf)
+      && (previous_frame = FRAME_TTY (sf)->previous_frame,
+         previous_frame != sf))
     {
-      /* Since frames on a single ASCII terminal share the same
-        display area, displaying a different frame means redisplay
-        the whole thing.  */
-      SET_FRAME_GARBAGED (sf);
+      if (previous_frame == NULL
+         || root_frame (previous_frame) != root_frame (sf))
+       {
+         /* Since frames on a single terminal share the same display
+            area, displaying a different frame means redisplay the
+            whole thing.  */
+         SET_FRAME_GARBAGED (sf);
 #if !defined DOS_NT && !defined HAVE_ANDROID
-      set_tty_color_mode (FRAME_TTY (sf), sf);
+         set_tty_color_mode (FRAME_TTY (sf), sf);
 #endif
+       }
       FRAME_TTY (sf)->previous_frame = sf;
     }