Subject: Re: bug#42406: Mouse-wheel scrolling can be flickering

From: Stefan Monnier <[email-masked]>
Date: Thu, 17 Dec 2020 18:24:26 -0500

> Why penalize people with >= 2 windows per selected frame when scrolling
> one of them by updating all the others' mode, header, tab lines?

Because nobody implemented the code to optimize that extra work away.
BTW, the patch below is what I use in my own branch now.

        Stefan

diff --git a/src/window.c b/src/window.c
index 20b0ef1525..c4f89b934e 100644
--- a/src/window.c
+++ b/src/window.c
@@ -224,7 +224,12 @@ wset_update_mode_line (struct window *w)
   Lisp_Object fselected_window = XFRAME (WINDOW_FRAME (w))->selected_window;
 
   if (WINDOWP (fselected_window) && XWINDOW (fselected_window) == w)
-    update_mode_lines = 42;
+    {
+      /* FIXME: This should be in xdisp.c, next to fset_redisplay
+         and friends!  */
+      update_mode_lines = 2;    /* FIXME: REDISPLAY_SOME  */
+      XFRAME (WINDOW_FRAME (w))->redisplay = true;
+    }
   else
     w->update_mode_line = true;
 }