From fa93733d3481c928112d13e31c30d7d36cfa6589 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 19 Sep 2013 14:28:37 +0300 Subject: [PATCH 1/1] Fixed screen restoration after popping down a menu. --- src/dispnew.c | 2 ++ src/term.c | 13 ++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/dispnew.c b/src/dispnew.c index fba38f1378..f1df96d75a 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -1930,6 +1930,8 @@ save_current_matrix (struct frame *f) to->glyphs[TEXT_AREA] = xmalloc (nbytes); memcpy (to->glyphs[TEXT_AREA], from->glyphs[TEXT_AREA], nbytes); to->used[TEXT_AREA] = from->used[TEXT_AREA]; + to->enabled_p = from->enabled_p; + to->hash = from->hash; if (from->used[LEFT_MARGIN_AREA]) { nbytes = from->used[LEFT_MARGIN_AREA] * sizeof (struct glyph); diff --git a/src/term.c b/src/term.c index e1175fac24..451d608842 100644 --- a/src/term.c +++ b/src/term.c @@ -2791,11 +2791,12 @@ DEFUN ("gpm-mouse-stop", Fgpm_mouse_stop, Sgpm_mouse_stop, /* TTY menu implementation and main ideas are borrowed from msdos.c. However, unlike on MSDOS, where the menu text is drawn directly to - the screen, on a TTY we use display_string (see xdisp.c) to put the - glyphs produced from the menu items into the desired_matrix glyph - matrix, and then call update_frame to deliver the results to the - glass. The previous contents of the screen, in the form of the - current_matrix, is stashed away, and used to restore screen + the display video memory, on a TTY we use display_string (see + display_tty_menu_item in xdisp.c) to put the glyphs produced from + the menu items directly into the frame's 'desired_matrix' glyph + matrix, and then call update_frame_with_menu to deliver the results + to the glass. The previous contents of the screen, in the form of + the current_matrix, is stashed away, and used to restore screen contents when the menu selection changes or when the final selection is made and the menu should be popped down. @@ -3086,6 +3087,8 @@ restore_desired_matrix (struct frame *f, struct glyph_matrix *saved) eassert (to->glyphs[TEXT_AREA] != from->glyphs[TEXT_AREA]); memcpy (to->glyphs[TEXT_AREA], from->glyphs[TEXT_AREA], nbytes); to->used[TEXT_AREA] = from->used[TEXT_AREA]; + to->enabled_p = from->enabled_p; + to->hash = from->hash; xfree (from->glyphs[TEXT_AREA]); nbytes = from->used[LEFT_MARGIN_AREA] * sizeof (struct glyph); if (nbytes) -- 2.20.1