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

From: Konrad Podczeck <[email-masked]>
Date: Thu, 17 Dec 2020 17:40:30 +0100

Let me reply that,  with the three critical instances of  wset_updated_mode_line just out-commented, when I scroll in a frame _with_ input focus, then the mode line is always correctly updated. If I scroll in a frame without input focus, then at least the percentage is always updated, and the line-number is update as soon as the (hollow) cursor reaches the top or the bottom of the range of text shown in the frame. In any case, with global-line-numbers-mode on, is there a situation where, in practice,  one needs to look at the line numbers as shown in the mode line?

> Am 17.12.2020 um 14:21 schrieb martin rudalics <[email-masked]>:
> 
> > Thanks! This did the job. Is there a way to exactly test whether the
> > (now) three out-commenting of wset_update_mode_line are really as
> > harmless at they appear? Could there be other scrolling problems, say
> > by scrolling via keys?
> 
> First of all I would replace these
> 
>  wset_update_mode_line (w);
> 
> with
> 
>  w->update_mode_line = true;
> 
> This way you make sure that the mode line does get updated whenever the
> scrolled window is on the selected frame.  Then problems should occur
> only when you either use the mouse wheel or the scroll bar on a
> non-selected frame.  In that case, the line number of the associated
> window might not get updated until its frame gets selected.
> 
> The (IMHO) right fix would be to have wset_update_mode_line add the
> frame containing the scrolled window to a list of frames the next
> redisplay should investigate.  This might still fail when say frame A is
> selected, a window on frame B was scrolled and the title format of frame
> C wants to display the line number of that window.  I wouldn't care
> about such pathological cases but maybe someone does.
> 
> martin