]> git.eshelyaron.com Git - emacs.git/commitdiff
Consider all windows for redisplay if frames have been cleared
authorGerd Möllmann <gerd@gnu.org>
Mon, 18 Nov 2024 15:50:51 +0000 (16:50 +0100)
committerEshel Yaron <me@eshelyaron.com>
Mon, 23 Dec 2024 14:54:47 +0000 (15:54 +0100)
* 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)

src/xdisp.c

index 474546da10697dc12292c97a6301b10365b926ae..bd94745abd1cf33c74a8128fe58b244070d6c008 100644 (file)
@@ -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)                                                      \
   {                                                                    \