Subject: Re: bug#77039: 31.0.50; Flickering on macOS

From: Gerd Möllmann <[email-masked]>
Date: Sat, 22 Mar 2025 21:20:09 +0100

Eli Zaretskii <[email-masked]> writes:

>> From: Gerd Möllmann <[email-masked]>
>> Cc: Aaron Jensen <[email-masked]>,  [email-masked],
>>   [email-masked]
>> Date: Sat, 22 Mar 2025 18:43:58 +0100
>> 
>> Eli Zaretskii <[email-masked]> writes:
>> 
>> > I'm afraid you will need to come up with a reproduction recipe for
>> > this, so that we could investigate what causes this.  Maybe it's a bug
>> > or maybe I'm missing something.
>> 
>> If it's something in Aaron's config, maybe he could bisect this.
>
> I hope so.
>
>> I'd also look for something doing things to mode-line-format first,
>> maybe.  But I also have no real idea what that is.
>
> Given that the glyph rows in question have their mode_line_p flag
> reset, is that still a possibility?

Hm, probably not.

But could this make a difference?

dispnew.c:
 5261 static int
 5262 scrolling_window (struct window *w, int tab_line_p)
 5263 {
 5264   struct glyph_matrix *desired_matrix = w->desired_matrix;
 5265   struct glyph_matrix *current_matrix = w->current_matrix;
 5266   int yb = window_text_bottom_y (w);
 5267   ptrdiff_t i;
 5268   int j, first_old, first_new, last_old, last_new;
 5269   int nruns, run_idx;
 5270   ptrdiff_t n;
 5271   struct row_entry *entry;
 5272   struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w)));
 5273 
 5274   /* Skip over rows equal at the start.  */
 5275   for (i = tab_line_p; i < current_matrix->nrows - 1; ++i)
                 ^^^^^^^^^^
                 (That can apparently be 0, 1, or 2. Bad name.)

 5276     {
 5277       struct glyph_row *d = MATRIX_ROW (desired_matrix, i);
 5278       struct glyph_row *c = MATRIX_ROW (current_matrix, i);
 5279 
 5280       /* If there is a row with a stipple currently on the glass, give
 5281          up.  Stipples look different depending on where on the
 5282          display they are drawn, so scrolling the display will produce
 5283          incorrect results.  */
 5284 
 5285       if (c->stipple_p)
 5286         return 0;
            ^^^^^^^^^^^^^^^^^
What's that stipple thing? Aaron, could that stipple be different
with an without your config?
 
 5287 
 5288       if (c->enabled_p
 5289           && d->enabled_p
 5290           && !d->redraw_fringe_bitmaps_p

Or something in the fringes?

 5291           && c->y == d->y
 5292           && MATRIX_ROW_BOTTOM_Y (c) <= yb
 5293           && MATRIX_ROW_BOTTOM_Y (d) <= yb
 5294           && row_equal_p (c, d, 1))

But that's clueless guessing.