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

From: Eli Zaretskii <[email-masked]>
Date: Thu, 17 Dec 2020 16:04:50 +0200

> Cc: Eli Zaretskii <[email-masked]>, Alan Third <[email-masked]>,
>  [email-masked]
> From: martin rudalics <[email-masked]>
> Date: Thu, 17 Dec 2020 08:29:48 +0100
> 
>  > To clarify my observation: If I comment out just the two calls to
>  > wset_update_mode_line that are in window_scroll_pixel_based, then the
>  > mouse wheel scrolling problem with multiple frames goes away, but the
>  > problem with scrolling via the scroll bars remains; if I comment out
>  > all five calls to wset_update_mode which are in window.c, then in
>  > addition the scroll-bar problem goes away (with multiple frames). I
>  > just wanted to know whether Martin has an idea which of the remaining
>  > three calls (when they are not out-commented) could be responsible for
>  > the scroll-bar problem.
> 
> I suppose it happens via 'scroll-bar-toolkit-scroll' calling
> 'scroll-bar-drag-1' calling 'set-window-start' so commenting out the
> 
>    wset_update_mode_line (w);
>    /* Bug#15957.  */
> 
> occurrence in Fset_window_start should cut it.

set-window-start is how Lisp programs tell the display engine to
scroll the display.  So if we agree that scrolling should trigger
update of the frame's elements other than the selected window, then
these calls to wset_update_mode_line are necessary and cannot be
removed.

As I said previously, patches are welcome to make the decision of what
exactly needs to be redrawn more fine-grained than the current "either
just the selected window or all the windows on all the frames" method.