> On 2022-07-05,, at 6:26 , Akib Azmain Turja wrote: > > Gerd Möllmann > writes: > >>>> >>> 1. What's the purpose of the following in >>> build_frame_matrix_from_leaf_window? "frame_row->used[TEXT_AREA]" will >>> always end up being equal to "window_matrix->matrix_w" after processing >>> the right-most window of the row. >> >> I don't understand. What about the /matrix_x/ + matrix_w below? > > Oh sorry, I meant "it will end up being equal to > *frame_matrix->matrix_w*". Probably. I don't remember what I thought exactly when I wrote that code. But, a few lines above what you mentioned there is /* Fill up the frame row with spaces up to the left margin of the window row. */ fill_up_frame_row_with_spaces (frame_row, window_matrix->matrix_x); In general, I prefer code that relies on what is known locally, instead of what is known more globally, so to speak. (We have too much of that already in Emacs.) Maybe that was the reason. In this case, because of the fill_up..., we know locally that the frame row is filled up to matrix_x of the window, so... >> In the TTY case, the glyph memory (struct glyph) for desired window matrices is sub-allocated from the glyph memory that is allocated for the frame. The glyph_row structures on the other hand are different between windows and frame. Clear_glyph_row doesn't affect the glyph memory, only the glyh_rows. > > I can't understand. What does that glyph memory contain? Individual > glyphs or the glyph matrix? If the glyph memory holds the glyph matrix, > then IIUC glyph row is a row of that glyph matrix, so why clearing that > doesn't affect the glyph matrix? It does affect a struct glyph_matrix, indirectly, because a struct glyph_row used by it is memset to zeros. But no struct glyph is modified by that. Please take a look at clear_glyph_row. Only bookkeeping information is cleared. The struct glyph_row points to struct glyphs, but the glyphs themselves are not changed. Have you read dispextern.h? There are some comments that might be helpful.