[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Questions on glyph matrices used for rendering frame in terminal

From: Akib Azmain Turja
Subject: Questions on glyph matrices used for rendering frame in terminal
Date: Mon, 04 Jul 2022 23:26:18 +0600

Hello hackers,

I'm currently trying to understand how Emacs builds the desired matrix
of a frame from the desired matrices of the windows in it.  But I can
barely understand anything.  I would be grateful if someone familiar
enough with it takes time to answer my following questions.

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.

--8<---------------cut here---------------start------------->8---
      /* Set number of used glyphs in the frame matrix.  Since we fill
         up with spaces, and visit leaf windows from left to right it
         can be done simply.  */
        = window_matrix->matrix_x + window_matrix->matrix_w;
--8<---------------cut here---------------end--------------->8---

2. From the documentation of make-terminal-frame:

> Note that changing the size of one terminal frame automatically
> affects all frames on the same terminal device.

But why?  Do they share glyph matrices, since only one of them is
visible at a single time?

3. Why clear the desired matrix in build_frame_matrix?  As I understand,
that would clear the glyph matrices of windows the frame, because window
desired matrix shares memory with frame desired matrix, and its seems
like build_frame_matrix is called after window desired matrices are

--8<---------------cut here---------------start------------->8---
  /* Clear all rows in the frame matrix covered by window matrices.
     Menu bar lines are not covered by windows.  */
  for (i = FRAME_TOP_MARGIN (f); i < f->desired_matrix->nrows; ++i)
    clear_glyph_row (MATRIX_ROW (f->desired_matrix, i));
--8<---------------cut here---------------end--------------->8---

4. And one more question: why don't Emacs is use the window feature of
ncurses despite depending on it?  Is it inefficient or lack of any

Thanks in advance, and apologies if this is not the right place to ask.

Akib Azmain Turja

This message is signed by me with my GnuPG key.  It's fingerprint is:

    7001 8CE5 819F 17A3 BBA6  66AF E74F 0EFA 922A E7F5

Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]