[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#22787: [PATCH] Allocate glyph matrices for the initial frame
From: |
Chris Feng |
Subject: |
bug#22787: [PATCH] Allocate glyph matrices for the initial frame |
Date: |
Wed, 24 Feb 2016 14:32:17 +0800 |
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
- bug#22787: [PATCH] Allocate glyph matrices for the initial frame,
Chris Feng <=