From: Gerd Möllmann Date: Mon, 18 Nov 2024 15:50:51 +0000 (+0100) Subject: Consider all windows for redisplay if frames have been cleared X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=703f65c640116f3fb726225876e560e3df8e54db;p=emacs.git Consider all windows for redisplay if frames have been cleared * src/xdisp.c (clear_garbaged_frames): Return true if any tty frame's current matrix has been cleared. (redisplay_internal): Consider all windows if clear_garbaged_frames returns true. (cherry picked from commit 196c761c66d47ff6a93d9134ca73d1c08a9125db) --- diff --git a/src/xdisp.c b/src/xdisp.c index 474546da106..bd94745abd1 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13415,18 +13415,22 @@ clear_message (bool current_p, bool last_displayed_p) message_buf_print = false; } -/* Clear garbaged frames. +/* Clear garbaged frames. Value is true if current matrices have been + cleared on at least one tty frame. This information is needed to + determine if more than one window has to be updated on ttys, whose + update requires building a frame matrix from window matrices. This function is used where the old redisplay called redraw_garbaged_frames which in turn called redraw_frame which in turn called clear_frame. The call to clear_frame was a source of flickering. I believe a clear_frame is not necessary. It should suffice in the new redisplay to invalidate all current matrices, - and ensure a complete redisplay of all windows. */ + and ensure a complete redisplay of all windows. */ -static void +static bool clear_garbaged_frames (void) { + bool current_matrices_cleared = false; if (frame_garbaged) { Lisp_Object tail, frame; @@ -13448,6 +13452,8 @@ clear_garbaged_frames (void) redraw_frame (f); else clear_current_matrices (f); + if (is_tty_frame (f)) + current_matrices_cleared = true; #ifdef HAVE_WINDOW_SYSTEM if (FRAME_WINDOW_P (f) @@ -13462,6 +13468,8 @@ clear_garbaged_frames (void) frame_garbaged = false; } + + return current_matrices_cleared; } @@ -17094,7 +17102,7 @@ redisplay_internal (void) do_pending_window_change (true); /* Clear frames marked as garbaged. */ - clear_garbaged_frames (); + bool current_matrices_cleared = clear_garbaged_frames (); /* Build menubar and tool-bar items. */ if (NILP (Vmemory_full)) @@ -17185,7 +17193,8 @@ redisplay_internal (void) overlay_arrows_changed_p (true); consider_all_windows_p = (update_mode_lines - || windows_or_buffers_changed); + || windows_or_buffers_changed + || current_matrices_cleared); #define AINC(a,i) \ { \