]> git.eshelyaron.com Git - emacs.git/commitdiff
Support frame dimension changes while TTY menus are displayed.
authorEli Zaretskii <eliz@gnu.org>
Fri, 11 Oct 2013 15:42:06 +0000 (18:42 +0300)
committerEli Zaretskii <eliz@gnu.org>
Fri, 11 Oct 2013 15:42:06 +0000 (18:42 +0300)
 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
src/ChangeLog
src/dispextern.h
src/dispnew.c
src/xdisp.c

index 42650a31c7ae318fd1e1041523ed354b6443f5bc..faf6724b7df2b2b20307d070591566a7f7b67f40 100644 (file)
@@ -1,3 +1,13 @@
+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
index 10cd3169408b15e45a56a0fa96b0a0fd54e38c64..2d09fe7c5fe3ccdeb8ac5815dadaf873bbc48817 100644 (file)
@@ -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 */
 
index d01de1853327fac5bc532969ca2133b23f878d67..3c0fda0b7457d7a2e703303937fee22d8d837a2d 100644 (file)
@@ -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];
index 7cfb0ab51ad16a6572f027e39d509891f13a0524..033d3b471479bb0d7f5810318950158f6d9af461 100644 (file)
@@ -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