all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Chris Feng <chris.w.feng@gmail.com>
To: 22787@debbugs.gnu.org
Subject: bug#22787: [PATCH] Allocate glyph matrices for the initial frame
Date: Wed, 24 Feb 2016 14:32:17 +0800	[thread overview]
Message-ID: <CAP4=87HYnFmjEKwY_K_kerVS2wEK4WoujRhMMhwn3FMgDs4z9g@mail.gmail.com> (raw)

After bd4de70f the initial frame is created without the glyph matrices
allocated.  As a result Emacs in batch/daemon mode would crash when evaluating
certain functions (e.g. line-pixel-height, window-text-pixel-size).


* src/frame.c (make_initial_frame): Allocate glyph matrices.

* src/dispnew.c (clear_glyph_matrix_rows): matrix->nrows can be 0.
---
 src/dispnew.c | 2 +-
 src/frame.c   | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/dispnew.c b/src/dispnew.c
index 433a6e9..f96db30 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -683,7 +683,7 @@ void
 clear_glyph_matrix_rows (struct glyph_matrix *matrix, int start, int end)
 {
   eassert (start <= end);
-  eassert (start >= 0 && start < matrix->nrows);
+  eassert (start >= 0 && start <= matrix->nrows);
   eassert (end >= 0 && end <= matrix->nrows);

   for (; start < end; ++start)
diff --git a/src/frame.c b/src/frame.c
index 8c86afe..4f61332 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -867,6 +867,9 @@ make_initial_frame (void)
   /* The default value of menu-bar-mode is t.  */
   set_menu_bar_lines (f, make_number (1), Qnil);

+  /* Allocate glyph matrices.  */
+  adjust_frame_glyphs (f);
+
   if (!noninteractive)
     init_frame_faces (f);

-- 
2.7.0





             reply	other threads:[~2016-02-24  6:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-24  6:32 Chris Feng [this message]
2016-02-24  8:04 ` bug#22787: [PATCH] Allocate glyph matrices for the initial frame martin rudalics
2016-02-24 17:25 ` Eli Zaretskii
2016-02-25  1:38   ` Chris Feng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAP4=87HYnFmjEKwY_K_kerVS2wEK4WoujRhMMhwn3FMgDs4z9g@mail.gmail.com' \
    --to=chris.w.feng@gmail.com \
    --cc=22787@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.