aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2013-10-11 18:42:06 +0300
committerEli Zaretskii2013-10-11 18:42:06 +0300
commitabe020201356dca6792d48add69029658b1df0b0 (patch)
tree48f0fc84ac14c7eb131ac3ef8da01383eabd684e /src
parent9428abbf51a05346caf1315130411af1811ba0f7 (diff)
downloademacs-abe020201356dca6792d48add69029658b1df0b0.tar.gz
emacs-abe020201356dca6792d48add69029658b1df0b0.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog10
-rw-r--r--src/dispextern.h1
-rw-r--r--src/dispnew.c3
-rw-r--r--src/xdisp.c9
4 files changed, 19 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 42650a31c7a..faf6724b7df 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,13 @@
12013-10-11 Eli Zaretskii <eliz@gnu.org>
2
3 * xdisp.c (deep_copy_glyph_row): Handle the case that FROM and TO
4 have different dimensions. (Bug#15575)
5
6 * dispnew.c (fill_up_frame_row_with_spaces): Now has external
7 visibility.
8
9 * dispextern.h (fill_up_frame_row_with_spaces): Add prototype.
10
12013-10-11 Dmitry Antipov <dmantipov@yandex.ru> 112013-10-11 Dmitry Antipov <dmantipov@yandex.ru>
2 12
3 * term.c (tty_menu_show): Never return with unbalanced 13 * term.c (tty_menu_show): Never return with unbalanced
diff --git a/src/dispextern.h b/src/dispextern.h
index 10cd3169408..2d09fe7c5fe 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -3472,6 +3472,7 @@ void init_display (void);
3472void syms_of_display (void); 3472void syms_of_display (void);
3473extern Lisp_Object Qredisplay_dont_pause; 3473extern Lisp_Object Qredisplay_dont_pause;
3474extern void spec_glyph_lookup_face (struct window *, GLYPH *); 3474extern void spec_glyph_lookup_face (struct window *, GLYPH *);
3475extern void fill_up_frame_row_with_spaces (struct glyph_row *, int);
3475 3476
3476/* Defined in terminal.c */ 3477/* Defined in terminal.c */
3477 3478
diff --git a/src/dispnew.c b/src/dispnew.c
index d01de185332..3c0fda0b745 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -77,7 +77,6 @@ static int required_matrix_height (struct window *);
77static int required_matrix_width (struct window *); 77static int required_matrix_width (struct window *);
78static void change_frame_size_1 (struct frame *, int, int, bool, bool, bool); 78static void change_frame_size_1 (struct frame *, int, int, bool, bool, bool);
79static void increment_row_positions (struct glyph_row *, ptrdiff_t, ptrdiff_t); 79static void increment_row_positions (struct glyph_row *, ptrdiff_t, ptrdiff_t);
80static void fill_up_frame_row_with_spaces (struct glyph_row *, int);
81static void build_frame_matrix_from_window_tree (struct glyph_matrix *, 80static void build_frame_matrix_from_window_tree (struct glyph_matrix *,
82 struct window *); 81 struct window *);
83static void build_frame_matrix_from_leaf_window (struct glyph_matrix *, 82static 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)
2503/* Add spaces to the end of ROW in a frame matrix until index UPTO is 2502/* Add spaces to the end of ROW in a frame matrix until index UPTO is
2504 reached. In frame matrices only one area, TEXT_AREA, is used. */ 2503 reached. In frame matrices only one area, TEXT_AREA, is used. */
2505 2504
2506static void 2505void
2507fill_up_frame_row_with_spaces (struct glyph_row *row, int upto) 2506fill_up_frame_row_with_spaces (struct glyph_row *row, int upto)
2508{ 2507{
2509 int i = row->used[TEXT_AREA]; 2508 int i = row->used[TEXT_AREA];
diff --git a/src/xdisp.c b/src/xdisp.c
index 7cfb0ab51ad..033d3b47147 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -20590,10 +20590,10 @@ static void
20590deep_copy_glyph_row (struct glyph_row *to, struct glyph_row *from) 20590deep_copy_glyph_row (struct glyph_row *to, struct glyph_row *from)
20591{ 20591{
20592 struct glyph *pointers[1 + LAST_AREA]; 20592 struct glyph *pointers[1 + LAST_AREA];
20593 int to_used = to->used[TEXT_AREA];
20593 20594
20594 /* Save glyph pointers of TO. */ 20595 /* Save glyph pointers of TO. */
20595 memcpy (pointers, to->glyphs, sizeof to->glyphs); 20596 memcpy (pointers, to->glyphs, sizeof to->glyphs);
20596 eassert (to->used[TEXT_AREA] == from->used[TEXT_AREA]);
20597 20597
20598 /* Do a structure assignment. */ 20598 /* Do a structure assignment. */
20599 *to = *from; 20599 *to = *from;
@@ -20603,7 +20603,12 @@ deep_copy_glyph_row (struct glyph_row *to, struct glyph_row *from)
20603 20603
20604 /* Copy the glyphs. */ 20604 /* Copy the glyphs. */
20605 memcpy (to->glyphs[TEXT_AREA], from->glyphs[TEXT_AREA], 20605 memcpy (to->glyphs[TEXT_AREA], from->glyphs[TEXT_AREA],
20606 from->used[TEXT_AREA] * sizeof (struct glyph)); 20606 min (from->used[TEXT_AREA], to_used) * sizeof (struct glyph));
20607
20608 /* If we filled only part of the TO row, fill the rest with
20609 space_glyph (which will display as empty space). */
20610 if (to_used > from->used[TEXT_AREA])
20611 fill_up_frame_row_with_spaces (to, to_used);
20607} 20612}
20608 20613
20609/* Display one menu item on a TTY, by overwriting the glyphs in the 20614/* Display one menu item on a TTY, by overwriting the glyphs in the