Commit abe02020 authored by Eli Zaretskii's avatar Eli Zaretskii

Support frame dimension changes while TTY menus are displayed.

 src/xdisp.c (deep_copy_glyph_row): Handle the case that FROM and TO
 have different dimensions.
 src/dispnew.c (fill_up_frame_row_with_spaces): Now has external
 visibility.
 src/dispextern.h (fill_up_frame_row_with_spaces): Add prototype.

Fixes: debbugs:15575
parent 9428abbf
2013-10-11 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (deep_copy_glyph_row): Handle the case that FROM and TO
have different dimensions. (Bug#15575)
* dispnew.c (fill_up_frame_row_with_spaces): Now has external
visibility.
* dispextern.h (fill_up_frame_row_with_spaces): Add prototype.
2013-10-11 Dmitry Antipov <dmantipov@yandex.ru>
* term.c (tty_menu_show): Never return with unbalanced
......
......@@ -3472,6 +3472,7 @@ void init_display (void);
void syms_of_display (void);
extern Lisp_Object Qredisplay_dont_pause;
extern void spec_glyph_lookup_face (struct window *, GLYPH *);
extern void fill_up_frame_row_with_spaces (struct glyph_row *, int);
/* Defined in terminal.c */
......
......@@ -77,7 +77,6 @@ static int required_matrix_height (struct window *);
static int required_matrix_width (struct window *);
static void change_frame_size_1 (struct frame *, int, int, bool, bool, bool);
static void increment_row_positions (struct glyph_row *, ptrdiff_t, ptrdiff_t);
static void fill_up_frame_row_with_spaces (struct glyph_row *, int);
static void build_frame_matrix_from_window_tree (struct glyph_matrix *,
struct window *);
static void build_frame_matrix_from_leaf_window (struct glyph_matrix *,
......@@ -2503,7 +2502,7 @@ fill_up_glyph_row_area_with_spaces (struct glyph_row *row, int area)
/* Add spaces to the end of ROW in a frame matrix until index UPTO is
reached. In frame matrices only one area, TEXT_AREA, is used. */
static void
void
fill_up_frame_row_with_spaces (struct glyph_row *row, int upto)
{
int i = row->used[TEXT_AREA];
......
......@@ -20590,10 +20590,10 @@ static void
deep_copy_glyph_row (struct glyph_row *to, struct glyph_row *from)
{
struct glyph *pointers[1 + LAST_AREA];
int to_used = to->used[TEXT_AREA];
/* Save glyph pointers of TO. */
memcpy (pointers, to->glyphs, sizeof to->glyphs);
eassert (to->used[TEXT_AREA] == from->used[TEXT_AREA]);
/* Do a structure assignment. */
*to = *from;
......@@ -20603,7 +20603,12 @@ deep_copy_glyph_row (struct glyph_row *to, struct glyph_row *from)
/* Copy the glyphs. */
memcpy (to->glyphs[TEXT_AREA], from->glyphs[TEXT_AREA],
from->used[TEXT_AREA] * sizeof (struct glyph));
min (from->used[TEXT_AREA], to_used) * sizeof (struct glyph));
/* If we filled only part of the TO row, fill the rest with
space_glyph (which will display as empty space). */
if (to_used > from->used[TEXT_AREA])
fill_up_frame_row_with_spaces (to, to_used);
}
/* Display one menu item on a TTY, by overwriting the glyphs in the
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment