From: Gerd Möllmann Date: Tue, 12 Nov 2024 08:23:27 +0000 (+0100) Subject: Fix a FIXME In redisplay_internal X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5b8b9e0af0d6b631e5b36d2a2b2ea4d304e041b6;p=emacs.git Fix a FIXME In redisplay_internal * src/xdisp.c (redisplay_internal): Compare root frames before setting the frame garbaged. (cherry picked from commit 37cdf2897ad51f45a228c86f5f12feeb284673df) --- diff --git a/src/xdisp.c b/src/xdisp.c index 7c69302df90..00db1857774 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -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; }